Difference between this() and super() in java ?

this() is used to access one constructor from another with in the same class while super() is used to access super-class constructor. Either this() or super() exists it must be the first statement in the constructor.


What is bytecode in java ?

When a javac compiler compiles a class it generates .class file. This .class file contains set of instructions called byte code. Byte code is a machine independent language and contains set of instructions which are to be executed only by JVM. JVM can understand this byte codes.


What is JIT compiler ?

JIT compiler stands for Just in time compiler. JIT compiler compiles byte code into executable code. JIT a part of JVM. JIT cannot convert complete java program in to executable code it converts as and when it is needed during execution.


What are the difference between c++ and Java ?

Both Java programming language and C++ are object-oriented programming languages, yet there are contrasts between them. Regardless, Java is an OOP language; accordingly, everything is a protest in Java (single root chain of command as everything gets got from java.lang.Object). Despite what might be expected. In C++, there is no


What is method overloading in java ?

A class having two or more methods with same name but with different arguments then we say that those methods are overloaded. Static polymorphism is achieved in java using method overloading.

Method overloading is used when we want the methods to perform similar tasks but with different inputs or values. When


Why java is platform independent?

The most unique feature of java is platform independent. In any programming language source code is compiled in to executable code. This cannot be run across all platforms. When javac compiles a java program it generates an executable file called .class file.

class file contains byte codes. Byte codes are interpreted


Differences between Overriding and Overloading in Java?

Overloading occurs when two or more methods in one class have the same method name but different parameters (i.e., method signature).

Overriding means having two methods with the same method name and parameters (i.e., method signature). One of the methods is in the parent class and the other is in the


What is super keyword in java ?

Variables and methods of super class can be overridden in subclass. In case of overriding, a subclass object call its own variables and methods. Subclass cannot access the variables and methods of super-class because the overridden variables or methods hides the methods and variables of super class.

But still java provides


What is Polymorphism in Java?

Polymorphism in Java is a concept by which we can perform a single action in different ways. Polymorphism is derived from 2 Greek words: poly and morphs. The word “poly” means many and “morphs” means forms. So polymorphism means many forms.

There are two types of polymorphism in Java: compile-time polymorphism


What is method overriding in java ?

If we have methods with same signature (same name, same signature, same return type) in super class and subclass then we say subclass method is overridden by super-class.
When to use overriding in java.

If we want same method with different behavior in super-class and subclass then we go for overriding.

When