Method Overriding in Java

In this tutorial, we will learn about Method Overriding in java. If we create a method in the child class with the same name as declared in parent class it is known as Method Overloading. Rules to perform Method Overloading in Java: Method name should be same as declared in Parent class. Parameter of the

Method Overriding in Java Read More »

Super keyword in Java

In this tutorial we will learn about super keyword in Java. super keyword in java refers to object of Parent class. Super keyword is mainly use to call super class methods or constructor of super class. Usage of super keyword: The super keyword can be used to use the variable of parent class in child class.

Super keyword in Java Read More »

This Keyword in Java

In this tutorial we will learn about this Keyword in Java. In very simple words this keyword in Java references to object of the current class. At present, it might be sound confusing. But you will find it easy after checking the following example: Example code: Class ThisExample{ String name; public ThisExample(String name){ this.name=name; } public void show(){

This Keyword in Java Read More »

Inheritance in Java

In this tutorial, we will learn about Inheritance in Java. Inheritance is a mechanism in which we can inherit properties(methods and variable) of one class into another. This helps us to create a new class that will have its own properties and properties of its parent class(from which the new class is inheriting features). While performing

Inheritance in Java Read More »

Static block in Java

In this tutorial, we will learn about Static block in Java. A very important thing about the static block is the static block belongs to class not to instance. That’s why static block only runs once it doesn’t matter how many numbers of instance we create. There are few things to note about the static block

Static block in Java Read More »

Instance block in Java

In this tutorial, we will learn about Instance block in Java. Instance blocks are used to initialize instance variables of the class. These blocks run every time when we create an object of the class. There are few things to note about instance blocks. we do not right any identifier with instance block instance block

Instance block in Java Read More »

Static Keyword in Java

In this tutorial, we will learn about static keyword in Java. The main motive of the static keyword in Java is memory management. We can use static keyword with variable, method and block. An important thing to know that a static method, variable and block can be used without creating an object of the class. Static Variable: To make

Static Keyword in Java Read More »

String in Java

In this tutorial, we will learn about String in Java. Some students think String is a primitive data type like int or char but In java String is a very smart and immutable class which is part of java.lang package. When we right a char sequence it represents the object of String class. Check the following example to

String in Java Read More »

×