Java instance initializers are code blocks which are executed before the constructor code is executed. These initializers run everytime we create a new object.
Java extends vs implements keywords
In Java, extends is used for extending a class and implements is used for implementing the interfaces. It’s the main difference between extends vs implements. 1. extends keyword In Java, we can inherit the fields and methods of a class by extending it using extends keyword. Please note that in Java, a class can extend […]
Java instanceof operator
Java instanceof operator (also called type comparison operator) is used to test whether the object is an instance of the specified type (class or subclass or interface). It returns – true – if variable is instance of specified class, it’s parent class or implement specified interface or it’s parent interface false – if variable is […]
Constructors in Java
Java constructors are special methods (without return type) which allow you to fully initialize the object state before it can be used by other classes inside application. Constructors in java are invoked using new keyword.
Inheritance In Java
Inheritance in java (IS-A relationship) is referred to the ability where child objects inherit or acquire all the properties and behaviors from parent object. In object oriented programming, inheritance is used to promote the code re-usability.
Association, Aggregation and Composition
Association, aggregation and composition are three relationships which classes can have in object oriented programming. Let’s understand their difference.
Java OOPs Concepts – Object Oriented Principles
In this Java OOPs concepts tutorial, we will learn four major object oriented principles– abstraction, encapsulation, inheritance, and polymorphism. They are also known as four pillars of the object oriented programming paradigm.
Multiple inheritance in Java
Multiple inheritance is a feature of some object-oriented computer programming languages in which an object or class can inherit characteristics and behavior from more than one parent object or parent class.
Java Access Modifiers
Java provides four access modifiers to set access levels for classes, variables, methods and constructors. Access level modifiers determine whether other classes can use a particular field or invoke a particular method.
Java Method Overloading vs Method Overriding
Learn the difference between method overloading and method overriding in java, which mainly involve method name, signature, parameters list and return type.
Instances of same class can access private members of each other
From this post onwards, I will spend few days in sharing some little known (if not unknown) features of java language, which we either don’t knew before or didn’t care to think differently. I will really appreciate if all you guys participate in discussion with your thoughts. And for being updated about next discussion point […]
Java Polymorphism with Example
In java, polymorphism is the ability by which, we can create functions or reference variables which behaves differently in different programmatic context.
Java override final static method – Method overriding or hiding?
Java override final static method. Why static method cannot be overridden in java? Can we override a non-static method as static in Java. Learn with example.
Java Encapsulation vs Abstraction
In this tutorial, I will explain the encapsulation in java and its relation with abstraction. Also learn about information hiding and implementation hiding.
Interface vs. Abstract Class in Java
Learn about java abstract classes vs interfaces in details. Also learn about when to use interface and when to use abstract class in solving design issues.
Abstraction in Java with Example
In simple words, java abstraction captures only those details about an object that is relevant to the current perspective. Learn more about abstraction in java.