Method Overloading in Java

java-thumbnail

Method Overloading is the concept of writing multiple methods with the same name. Here the common characteristic is only the name. Parameters must be different. Return type can be anything. Also note that method overloading is within same class or inherited class. Look at the below points on how to overload a method. All the […]

Method Overriding in Java

java-thumbnail

Method Overriding is concept of overriding a same method in the child class. This is fall under the dynamic polymorphism ¬†or run time polymorphism. A method defined in the parent class is considered as the common behaviour¬†and the child classes are expected to override the common behaviour with own implementation. There are multiple restrictions enforced […]

Instanceof Operator

java-thumbnail

Instanceof Operator is important for writing the condition to check if a particular variable reference is of specific type / class. In short it is type checking condition. This operator returns true or false depends on the condition output. It always return false if you compare null value with any class. Lets look at an […]

Instance Initializer in Java

java-thumbnail

Instance initializer in Java is used for initializing the instance variables inside a class. It is a simple block without any modifiers used inside any class. If you declare a instance variable with value, then this value can be overridden in the instance initializer or in the constructor. The order of the execution as follows: […]

Access Modifiers in Java

java-thumbnail

This tutorials explains the various access modifiers used in Java language and the scope for the each modifier. There is four types of access modifiers in Java. private default protected public Private Modifier If you declare anything private inside a class, then it must be accessed inside that class. Other classes can not access that […]

Java Keywords

java-thumbnail

Java has more than 50 keywords for the different operations. Here is the list of all the keywords and its purpose. Keyword Description abstract Abstract keyword can be use with classes and methods to defer the actual implementation to the child classes. assert This keyword used for testing the truth of a condition. boolean Indicates […]

Static Keyword

java-thumbnail

Static keyword in Java used for indicating the members are belong to the class and not to the instance. It means that, if you declare a static members, it is shared among all the instances of that class. Also note that the static members are initialized before the instance creation of that class. Static keyword […]

Final Keyword

java-thumbnail

Final keyword in Java language is used with variables, methods and classes. The general idea behind the use of final is to restrict the manipulation of original value. Variables – The initial value can not be changed once it is assigned. You can initialize the final variable first time, but later it is not allowed […]

Abstract Keyword

java-thumbnail

Abstract keyword is used with class and method declaration. Abstract defines incomplete data structures where the final or complete implementation will be done by its child class. In Java, Abstract used for defining the common behaviour for a class and let the child class to override the common behaviour. Some of the characteristics of the […]