Java OOPs Concepts

we will help you to understand about Java OOP’S concepts with examples. oops concepts in java

Java Made Simple: What is Java static with Example?

Java static is access modifier. Access specifier specifies access. Given Example and Screenshot Simple terms. Go on read. The "static" is one of the keywords (not reserved and prohibited) of Java. It is used as an access modifier. An access modifier modifies the access and it differs from access specifier in that access specifier specifies …

Java Made Simple: What is Java static with Example? Read More »

Java private abstract Method with Example

An abstract class is permitted to have both concrete and abstract methods. In abstract class, no method (either concrete or abstract) can be private. The reasons are very simple and when known looks as of common sense. Let us make a list to remember. Abstract methods in an abstract class cannot be private but can …

Java private abstract Method with Example Read More »

What is interface in Java with realtime Example?

Java interface realtime examples Summary: By the end of this tutorial "Java interface realtime examples", you know what is interface with realtime examples. Java interface realtime examples Interface differs from abstract class in that interface contains only abstract methods. All methods should be public and abstract; if just omitted by the Programmer by style, Java …

What is interface in Java with realtime Example? Read More »

What is Java abstract method abstract class with Example?

I explain the Java abstract method and abstract class in a different style where it is easier to understand the concept. One day, the Chief Design Engineer of Maruthi Suzuki thought every vehicle that rolls out of factory should have some common features. He designs an abstract class as follows and demands all the Design …

What is Java abstract method abstract class with Example? Read More »

Why Java interface required A full discussion with Example?

For better knowledge of Java interface, the explanation is given in Questions/Answers form, an easy way to understand fast. 1. What is an interface in Java? a) An interface contains only abstract methods (not even one concrete method). b) It differs from abstract class in that abstract class can contain concrete methods also. 2. Can …

Why Java interface required A full discussion with Example? Read More »

Static Polymorphism Dynamic Polymorphism

Static Polymorphism Dynamic Polymorphism Summary: By the end of this tutorial "Static Polymorphism Dynamic Polymorphism", you will understand their differences. Explained with programs in simple words. It is the continuation of previous program Difference: Static binding and Dynamic binding and knowledge of binding is very much required for better understanding this concept as binding leads …

Static Polymorphism Dynamic Polymorphism Read More »

Java Made Clear: Difference Static binding Dynamic binding

Difference Static binding Dynamic binding Java, being an OOPs language, supports both static binding and dynamic binding. Coming to our topic, a class may have overloaded and overridden methods. When to call which method is decided (binded) sometimes by compiler and sometimes by JVM at runtime. Why this disparity? Why Java is designed like this? …

Java Made Clear: Difference Static binding Dynamic binding Read More »

Can you create interface reference variables?

interface reference variables It is stated in my earlier posting Can you create instance of interface? that we cannot create objects of interfaces but possible as an inner class. Now the present question is can we create interface reference variables and if permitted what is the use of these reference variables as interface does not …

Can you create interface reference variables? Read More »

abstract class vs final class

Abstract class and Final class are very different basically in their nature and usage in Java language. Both are very contrary in their functionality. Following table gives the differences: abstract class vs final class. Property Abstract class Final class Subclassing Should be subclassed to override the functionality of abstract methods Can never be subclassed as …

abstract class vs final class Read More »

Java Made Clear: Difference between Abstract class Interface

Difference Abstract class Interface Summary: By the end of this tutorial" Difference Abstract class Interface", you will be comfortable to their differences. Introduction A novice feels why both abstract class and interface are required in Java as an abstract class can contain all abstract methods also. The main difference just on the face is Interface …

Java Made Clear: Difference between Abstract class Interface Read More »

Java Made Clear: Difference between static and final Keywords

static vs final java, both are known access modifiers in Java doing different functionalities (used for different jobs). static: static keyword can be applied to instance variables and methods but not to classes. When applied, variables and methods can be called without the help of an object. When a method or variable is called without …

Java Made Clear: Difference between static and final Keywords Read More »

Java Made Clear: Difference between this and super Example

Basically, both this vs super Java are keywords performing different jobs. this keyword refers an object super keyword refers a super class variable or method A) Meaning, Purpose and Usage of this Keyword this refers an object, that too, a current object. What is current object? To understand better, let us write a small program …

Java Made Clear: Difference between this and super Example Read More »

this() Java : Calling constructor from constructor of same class

We have seen earlier constructor overloading with example. In constructor overloading, multiple constructors exist within the same class. Generally, to call multiple constructors, we create multiple objects; almost one object to call each constructor. Now the question is, Is there anyway to call all the constructors with one object creation? Yes, there is. The magic …

this() Java : Calling constructor from constructor of same class Read More »

Java Constructor Creation with Example

Java Constructor plays an important role in code development. A constructor looks like a method but without any return type. Moreover, the name of the constructor and class name should be the same. The advantage of constructor is it is called implicitly when an on object is created. That is, we write a constructor but …

Java Constructor Creation with Example Read More »

Java Constructor with Example

The constructs (building blocks) of a Java class are variables, constructors, methods and some rarely used static blocks etc. Now let us discuss Java Constructor. 1. What is constructor or features of constructor? A Java Constructor has the following two features. A constructor looks like a method but without any return type (even void should …

Java Constructor with Example Read More »

What is difference between super and super() in Java?

super and super() look alike, but they are very different in their functionality (purpose). super with variables and methods: super is used to call super class variables and methods by the subclass object when they are overridden by subclass. super() with constructors: super() is used to call super class constructor from subclass constructor. Let us …

What is difference between super and super() in Java? Read More »