Tagged: Java

Call by value

Call by value in java

In java, we have only ‘Call by value’, not ‘Call by reference’. In ‘Call by reference’ the address of the value is passed in the arguments of the methods, so if any changes made...

Encapsulation in java

Encapsulation in java

Encapsulation is one of the four fundamental OOP concepts. Remaining three are inheritance, polymorphism, and abstraction.In the previous post, we have studied the Abstract class and interface. In this post, we will focus on encapsulation....

Polymorphism in Java

Polymorphism in Java

In the previous post, we have seen Initializer Block.In this post , we will see what is polymorphism in Java. In object oriented programming, we know it is best at providing the reusability of the...

Initialization block in java

Initialization block in java

Initialization blocks as name says can be used to initialize the objects or data members in java. An initialization block contains a group of statements enclosed in a pair of braces. Syntax : {...

super keyword in java

super keyword in java

In the previous session, we have seen the usage of method overriding. In this session, we will see how to use the keyword super in java programming. The super keyword is used to refer immediate parent class members....

Method Overriding in Java

Method Overriding in Java

  In parent class we have a method, and the same method is declared in child class is known as method overridding. Before we have seen method overloading, now we will discuss method overriding in...

Method Overloading in java

Method Overloading in java

Every class has one or more methods which are used to perform different functionalities in the application. Can we have two methods having the same name in one class? Yes, we can have two or more methods...

Aggregation in java

Aggregation in java

The most important advantage of Object oriented programming is code reusability. Aggregation means making a relationship or association between 2 classes. There is one directional association between the classes that represent Has-A relationship. As an example suppose,...

this keyword

this keyword

In java, this keyword is used as a reference of the current object. Here are few important usage of this keyword. this keyword represent current instance of the class. this can be used to call default constructor or...

Access modifiers

Access modifiers

In java, there are 4 types of access modifiers which are as follows. Public Private default protected We check their accessibility at 4 levels which are. Class level Subclass level Its own Package level...