What is Polymorphism?
Polymorphism means many forms. A single object can refer to the super-class or sub-class depending on the reference type which is called polymorphism. Example: Public class Manipulation(){ //Super class public…
Polymorphism means many forms. A single object can refer to the super-class or sub-class depending on the reference type which is called polymorphism. Example: Public class Manipulation(){ //Super class public…
Purpose of Encapsulation: Protects the code from others. Code maintainability. Example: We are declaring ‘a’ as an integer variable and it should not be negative. public class Addition(){int a =…
Inheritance means one class can extend to another class. So that the codes can be reused from one class to another class. The existing class is known as the Super class…
OOPs concepts include: Inheritance Encapsulation Polymorphism Abstraction Interface
An instance of a class is called an object. The object has state and behavior. Whenever the JVM reads the “new()” keyword then it will create an instance of that…
All Java codes are defined in a Class. It has variables and methods. Variables are attributes which define the state of a class. Methods are the place where the exact business logic…
Local variables are defined in the method and scope of the variables that exist inside the method itself. Instance variable is defined inside the class and outside the method and the scope…
When a new object is created in a program a constructor gets invoked corresponding to the class. The constructor is a method which has the same name as the class…
Java uses Just In Time compiler to enable high performance. It is used to convert the instructions into bytecodes.
Features of Java are as follows: OOP concepts Object-oriented Inheritance Encapsulation Polymorphism Abstraction Platform independent: A single program works on different platforms without any modification. High Performance: JIT (Just In Time compiler)…