JAVA Interview Questions

Ques. What is JAVA?

Ans. Java is a high-level programming language and is platform independent.Java is a collection of objects. It was developed by Sun Microsystems.There are a lot of applications, websites and Games that are developed using Java.

Ques. How does Java enable high performance?

Ans. Java uses Just In Time compiler to enable high performance. JIT is used to convert the instructions into bytecodes.

Ques. What is meant by Local variable and Instance variable?

Ans. Local variables are defined in the method and scope of the variables that have existed inside the method itself. An instance variable is defined inside the class and outside the method and scope of the variables exist throughout the class.

Ques. What are the Oops concepts?

Ans. Oops concepts include: • Inheritance • Encapsulation • Polymorphism • Abstraction • Interface

Ques. What is meant by Method Overriding?

Ans. Method overriding happens if the sub class method satisfies the below conditions with the Super class method: • Method name should be same • Argument should be same • Return type also should be same The key benefit of overriding is that the Sub class can provide some specific information about that sub class type than the super class.

Ques. Why Java is called as platform independent?

Ans. Java is called platform independent because of its byte codes which can run on any system irrespective of its underlying operating system. Any java code internally converted in to its byte code.

Ques. Is Java code 100% object orineted?

Ans. No it is not 100% object oriented language as it makes use of eight primitive data types like boolean, byte, char, int, float, double, long, short which are not objects

Ques. What is the difference between equals() method and == operator in Java?

Ans. equals() method is defined in Object class in Java and used for checking equality of two objects. “==” or equality operator in Java is a binary operator provided by Java programming language and used to compare primitives and objects.

Post Question