Java Interview Questions

Top 50+ most asked Java Interview Question with Answers for freshers and experienced candidates.

Java is one of the most popular, secure, and high-level programming languages because it is a platform independent programming language. Questions are listed below:

Java Interview Questions
Java Interview Questions & Answers

Q1- What is Java?

Java is a platform independent and high-level, most secure, and object-oriented programming language. It was developed by Sun Microsystems.

Q2- What is the diffrence between JDK, JRE and JVM?

JDK - JDK stands for Java Development Kit.
JRE - JRE stands for Java Runtime Environment.
JVM - JVM stands for Java Virtual Machine that enables the computer to run the Java program.

Q3- Why Java is platform independent?

Java is platform independent because of its byte codes which can run on any system irrespective of its underlying operating system.

Q4- What are the principle of Oops concepts in Java?

There are four principle used in Java Oops concepts:

  • Inheritance
  • Encapsulation
  • Polymorphism
  • Abstraction

Q5- What is JIT compiler?

JIT stands for Just-In-Time compiler. Just-In-Time compiles parts of the bytecode that have similar functionality at the same time, and hence reduces the amount of time needed for compilation.

Q6- What is this keyword in java?

This Keyword is a reference to the current object, use to refer current class instance variable. And used to invoke current class method.

Q7- What are the features in Java?

There are following features listed in Java programming language:

  • Oops concepts
  • Platform Independent
  • High Performance JIT Compiler
  • Multi-threaded

Q8- What are constructors in Java?

The constructor refers to a block of code which is used to initialize an object and there are two constructors use in Java mentained below:

  • Default Constructor - Default constructors are the no argument constructors
  • Parameterized Constructor - Initializing the instance variables with the provided values

Q9- What are the various access specifiers in Java?

  • Public
  • Protected
  • Default
  • Private

Q10- What is an object?

The Object is the real-time entity, it having behavior and state. And In Java, The object of a class created by using the new keyword.

Q11- Does constructor return any value?

The constructor implicitly returns the current instance of the class.

Q12- Is constructor inherited?

The constructor is not inherited.

Q13- What is Encapsulation?

Encapsulation is a principle of Oops concepts and a technique used for hiding the properties and behaviors of an object. Encapsulation allow outside access only as appropriate.

Q14- What are the Java IDE's?

NetBeans and Eclipse are the IDE's of Java

Q15- What is a Class?

Basically, All Java codes are written within a class. And a class is the collection of variables and methods.

Q16- What is Inheritance?

Actually, Inheritance means that one class can extend to another class. Inheritance is applicable for public and protected members only.

Q17- What is the difference between path and classpath variable?

Path - It is used to find out binary files location by command prompt
Classpath - It is used by compiler and JVM to find out location of library files

Q18- What is implicit casting?

Implicit casting is a process of converting lower range datatype variable to higher range datatype variable.

Q19- What is explicit casting?

Explicit casting is a process of converting higher range datatype variable to lower range datatype variable with the help of cast operator.

GDATAMART

We are optimized for learning and job information. We try to improve your knowledge and practical experience through this site but we cannot warrant full correctness of all content. Our Privacy & Policy →

© 2019 gdatamart.com | All Rights Reserved