Showing posts with label PPL. Show all posts
Showing posts with label PPL. Show all posts

Thursday, 3 March 2022

enum in Java | Enumeration - enum in Java Programming Tutorial | enums Java

                  In this post, we will see enum in Java | Enumeration - enum in Java Programming Tutorial | enums Java | enum in java, enums java, enum in java language, enum in java language


Watch following video:

Watch on YouTube: https://www.youtube.com/watch?v=iZV_ed7eM14

Sunday, 5 September 2021

Final Keyword in Java with Example | Final Variable, Method and Class in Java

                     In this post, we will see Final Keyword in Java with Example | Final Variable, Method and Class in Java.


Watch following video:

Watch on YouTube: https://www.youtube.com/watch?v=ZPu86vWw5vc

Super Keyword in Java Part 2 | Super Keyword in Inheritance Java | Method Overriding in Java

                   In this post, we will see Super Keyword in Java Part 2 | Super Keyword in Inheritance Java | Method Overriding in Java.


Watch following video:

Watch o YouTube: https://www.youtube.com/watch?v=rm_eI4F816A

Super Keyword in Java Part 1 | Super Method in Constructor Java with Example | Inheritance Java

                     In this post, we will see Super Keyword in Java Part 1 | Super Method in Constructor Java with Example | Inheritance Java.


Watch following video:

Watch on YouTube: https://www.youtube.com/watch?v=os1j1Ps22SE

Interface in Java with Example | Multiple Inheritance in Java using Interface | Interface and Class

                 In this post, we will see Interface in Java with Example | Multiple Inheritance in Java using Interface | Interface and Class. 


Watch following video:

Watch on YouTube: https://www.youtube.com/watch?v=LjUqQ3vzW9k

Sunday, 4 July 2021

Exception Handling in Java with Example Programs | try catch throw throws finally in Java

                In this post, we will see Exception Handling in Java with Example Programs | try catch throw throws finally in Java | exceptions in java, exception handling in java, exception handling, exception handling in java interview questions, exception handling in java with example program, exception handling in java with realtime examples, exception handling in java with examples, try throw catch java, try catch throw throws finally java, explain try catch throw throws finally in java 


Watch following video:

Watch on YouTube: https://www.youtube.com/watch?v=ftZppBhd6Io

Exception Handling in C++ with Examples | C++ Exception Handling

                 In this post, we will see Exception Handling in C++ with Examples | C++ Exception Handling | exception handling in c++, exception handling, c++ exception handling, c++ exception, c++ exception class, c++ exception handling interview questions, c++ exception base class, c++ custom exception, c++ standard exceptions 


Watch following video:

Watch on YouTube: https://www.youtube.com/watch?v=6ECeHQIe-cM

Checked and Unchecked Exceptions in Java with Examples | Checked vs Unchecked Exceptions Java

                     In this post, we will see Checked and Unchecked Exceptions in Java with Examples | Checked vs Unchecked Exceptions Java | checked and unchecked exceptions in java, checked exception and unchecked exception, checked vs unchecked exceptions java, checked exception in java 


Watch following video:

Watch on YouTube: https://www.youtube.com/watch?v=flgucPuCjmw

Difference Between Error and Exception in Java

                    In this post, we will see Difference Between Error and Exception in Java, difference between error and exception in java, difference between error and exception 


Watch following video:

Watch on YouTube: https://www.youtube.com/watch?v=STlE3xI4Xdo

Sunday, 27 June 2021

Dynamic Method Dispatch | Runtime Polymorphism in Java | Virtual & Pure Virtual Function | Abstract

                   In this post, we will see Dynamic Method Dispatch | Runtime Polymorphism in Java | Virtual & Pure Virtual Function | Abstract | runtime polymorphism, runtime polymorphism in java, runtime polymorphism vs compile time polymorphism, runtime polymorphism and compile time polymorphism, dynamic method dispatch in java, dynamic method dispatch, dynamic method, dynamic method binding, virtual function, pure virtual function, abstract class, abstract class and abstract method, abstract class in java 


Watch following video:

Watch on YouTube: https://www.youtube.com/watch?v=P0bYsQbVido

Virtual and Pure Virtual Function in C++ | Abstract Class | Runtime vs Compile Time Polymorphism

                   In this post, we will see Virtual and Pure Virtual Function in C++ | Abstract Class | Runtime vs Compile Time Polymorphism | virtual function in c++, pure virtual function, pure virtual function in c++, abstract class, abstract class in c++, runtime polymorphism, runtime polymorphism vs compile time polymorphism, runtime polymorphism and compile time polymorphism 


Watch following video:

Watch on YouTube: https://www.youtube.com/watch?v=skglU3WpYKE


this Keyword in Java with Example Program | Java this Keyword

                    In this post, we will see this Keyword in Java with Example Program | Java this Keyword | this keyword in java, this keyword, this keyword in java with example program, java this keyword 


Watch following video:

Watch on YouTube: https://www.youtube.com/watch?v=jKNr9IIvSro

Friday, 4 June 2021

Java Input From User | How To Take Input From User in Java Using Scanner | Java Input From Keyboard

                   In this post, we will see Java Input From User | How To Take Input From User in Java Using Scanner | Java Input From Keyboard | how to take input from user in java, how to take input from user in java using scanner, java input from user, java input output tutorial, java input output stream tutorial, java input output stream, java input and output, java inputstream, java input output statements, java input statement, java input method, java input string, java input from keyboard 


Watch following video:

Watch on YouTube: https://www.youtube.com/watch?v=yywuTU6qFqY

Hello World Program in Java | Hello World Program in Java Code | Hello World Program in Java cmd

                 In this post, we will see Hello World Program in Java | Hello World Program in Java Code | Hello World Program in Java cmd | hello world program in java, hello world program in java notepad, hello world program in java in ubuntu, hello world program in java code, hello world program in java cmd 


Watch following video:

Watch on YouTube: https://www.youtube.com/watch?v=l12CSvFlWyM

 

Wednesday, 5 May 2021

Functional and Logic Programming Languages | Functional Programming Paradigm | Logic or Rule Based

                   In this post, we will see Functional and Logic Programming Languages | Functional Programming Paradigm | Logic or Rule Based | functional and logic programming languages, functional and logic model, functional and logic programming, functional programming, functional programming paradigm, applicative programming language, logic and rule based programming 


Watch following Video:

Watch on YouTube: https://www.youtube.com/watch?v=1NDnaRd2yzU

Friday, 30 April 2021

Procedural vs Object Oriented Programming Paradigms | PPL

                        In this post, we will see Procedural vs Object Oriented Programming Paradigms | PPL | procedural programming vs object oriented programming, ppl 


Watch following Video:

Watch on YouTube: https://www.youtube.com/watch?v=R2SusQaU9ws


Imperative and Declarative Programming Paradigms | Imperative vs Declarative Programming | PPL

                     In this post, we will see Imperative and Declarative Programming Paradigms | Imperative vs Declarative Programming | PPL | imperative and declarative programming paradigms, imperative and declarative programming, imperative vs declarative programming, declarative vs imperative programming, imperative programming vs declarative programming, ppl, principles of programming languages 


 Watch following Video: 

 Watch on YouTube: https://www.youtube.com/watch?v=xUI8Senv3PE 

Monday, 19 April 2021

Statement Level Control Structures | Selection Iterative Statements | Unconditional Branching | PPL

                    In this post, we will see Statement Level Control Structures | Selection Statements | Iterative Statements | Unconditional Branching | PPL | Sebesta | statement level control structures, selection statements, iterative statements, unconditional branching, ppl, sebesta   


Statement level Control Statements:

              Two linguistic mechanisms which are necessary to make the computations in programs flexible and powerful: some means of selecting among alternative control flow paths (of statement execution) and some means of causing the repeated execution of statements or sequences of statements.

              Statements that provide these kinds of capabilities are called control statements.

 

              It was proven that all algorithms that can be expressed by flowcharts can be coded in a programming language with only two control statements:

one for choosing between two control flow paths and one for logically controlled iterations (Böhm and Jacopini, 1966). 

 

              A control structure is a control statement and the collection of statements whose execution it controls.

 

e.g.

if(a>b)

{

---

---

}

else

{

---

---

}

 

1. Selection Statements

              A selection statement provides the means of choosing between two or more execution paths in a program.

 

e.g.

simple if

if else

Nested if

else if ladder

switch

 

2. Iterative Statements

              An iterative statement is one that causes a statement or collection of statements to be executed zero, one, or more times.

              An iterative statement is often called a loop.

e.g.

for

while

do while

 

 

3. Unconditional Branching

              An unconditional branch statement transfers execution control to a specified location in the program.

              Without restrictions on use, imposed by either language design or programming standards, goto statements

can make programs very difficult to read, and as a result, highly unreliable and costly to maintain.

              A few languages have been designed without a goto for example, Java, Python, and Ruby.

              The relatively new language, C#, includes a goto, even though one of the languages on which it is based, Java, does not.


e.g. goto statement


Watch following video:

Watch on YouTube: https://www.youtube.com/watch?v=wOHPuZ3PFFw

Pointer and Reference Types | PPL | Sebesta | Data Types in Programming Language

                     In this post, we will see Pointer and Reference Types | PPL | Sebesta | Data Types in Programming Language | data types in ppl, data types ppl, elementary data types in programming language, ppl, sebesta, pointer and reference types  


9. Pointer and reference Type

 

Definition:

              A pointer type is one in which the variables have a range of values that consists of memory addresses and a special value, nil.

 

              A pointer can be used to access a location in an area where storage is dynamically allocated called a heap.

 

              Variables that are dynamically allocated from the heap are called heap-dynamic variables.

 

 

Dangling Pointer

              A dangling pointer, or dangling reference, is a pointer that contains the address of a heap-dynamic variable that has been deallocated.

 

 

Example from C++ Language:

 

int * ptr1;

int * ptr2 = new int[100];

ptr1 = ptr2;

delete [] ptr2;

 

              Here,  ptr1 and  ptr2, both will be dangling pointers.

 

              Java class instances are implicitly deallocated (there is no explicit deallocation operator), there cannot be dangling references in Java.

 

 

Reference Type:

              A reference type variable is similar to a pointer, with one important and fundamental difference: A pointer refers to an address in memory, while a reference refers to an object or a value in memory.

 

Example:

 

int a = 0;

int &b = a;

b = 100;

 

              In this code segment, variables a and b are aliases. b is reference to a.


 Watch following video:

Watch on YouTube: https://www.youtube.com/watch?v=taPeDr8GNA0

Union Types | Discriminated Union vs Free Union With Example | PPL | Sebesta | Data Types

                   In this post, we will see Union Types | Discriminated Union vs Free Union With Example | PPL | Sebesta | Data Types in Programming Language | data types in ppl, data types ppl, elementary data types in programming language, ppl, sebesta, union types,discriminated union, union, tagged union, free union, discriminated vs free union   


8. Union Types

              A union is a type whose variables may store different type values at different times during program execution.

 

Record vs Union

 

struct sample

{

int x;

float y;

char z;

};

 

union sample

{

int x;

float y;

char z;

};

 

union sample x;

 

Free Unions vs Discriminated Unions

 

              C and C++ provide union constructs in which there is no language support for type checking.

              The unions in these languages are called free unions, because programmers are allowed complete freedom from type checking in their use.

 

 

union sample

{

int a;

float b;

};

union sample myunion;

float x;

 

myunion.a = 27;

x = myunion.b;

 

              Type checking of unions requires that each union construct include a type indicator. Such an indicator is called a tag, or discriminant, and a union with a discriminant is called a discriminated union.

              The first language to provide discriminated unions was ALGOL 68. They are now supported by Ada, ML, Haskell, and F#.

 

Unions in Ada

 

e.g.

type Shape is (Circle, Triangle, Rectangle);

type Colors is (Red, Green, Blue);

 

type Figure (Form : Shape) is

       record

              Filled : Boolean;

              Color : Colors;

              case Form is

                      when Circle =>

                             Diameter : Float;

                      when Triangle =>

                             Left_Side : Integer;

                             Right_Side : Integer;

                             Angle : Float;

                      when Rectangle =>

                             Side_1 : Integer;

                             Side_2 : Integer;

              end case;

       end record;

 

 

Figure_1 : Figure;

Figure_2 : Figure(Form => Triangle);

 

Here,

Figure_1 is unconstrained variant record.

Figure_2 is constrained variant record.

 

Unions in F#

 

type intReal =

| IntValue of int

| RealValue of float;;

 

 

A compile-time descriptor for a discriminated union

 

type Node (Tag : Boolean) is

       record

              case Tag is

                      when True => Count : Integer;

                      when False => Sum : Float;

              end case;

       end record;


 

 

 Watch following video:

 Watch on YouTube: https://www.youtube.com/watch?v=aXs4Ugvjwwc