Styrow.dev
⚡ Framework Hub

Java Interview Questions

Practice 247 curated Java questions, code challenges, and conceptual deep-dives for tech interviews.

Backend Developer Interview Prep Icon
⚡ In Active Development 4.9 ★★★★★

Backend Developer Interview Prep

Master Java, Spring Boot, Microservices & System Design offline.

📱 100% Offline Access⚙️ Spring Boot & System Design🎯 Track Interview Progress
📱 Practice SDET Engine Live→
Backend Developer Interview Prep is currently in closed testing. Practice with our live SDET engine offline!

All Java Questions

Java medium

Base class for Error and Exceptions?

Topic: General Read →
Java medium

Break statement can be used as labels in Java?

Topic: General Read →
Java medium

Can a class declared as private be accessed outside it's package?

Topic: General Read →
Java medium

Can a class extend an interface?

Topic: General Read →
Java medium

Can a constructor be made final?

Topic: General Read →
Java medium

Can a double value be cast to a byte?

Topic: General Read →
Java medium

Can a local class declared inside a static method have access to the instance members of the outer class?

Topic: General Read →
Java medium

Can a method local inner class access the local final variables?Why?

Topic: General Read →
Java medium

Can a static nested class have access to the enclosing class non-static methods or instance variables?

Topic: General Read →
Java medium

Can a top level class be private or protected?

Topic: General Read →
Java medium

Can Abstract methods in parent class have a body?

Topic: General Read →
Java medium

Can an abstract class have a constructor?

Topic: General Read →
Java medium

Can an abstract class have a static method?

Topic: General Read →
Java medium

Can an anonymous class define method of its own?

Topic: General Read →
Java medium

Can an anonymous class implement an interface and also extend a class at the same time?

Topic: General Read →
Java medium

Can an exception be rethrown?

Topic: General Read →
Java medium

Can an interface be final?

Topic: General Read →
Java medium

Can an Interface extend another Interface?

Topic: General Read →
Java medium

Can an unreferenced object be referenced again?

Topic: General Read →
Java medium

Can constructor be inherited?

Topic: General Read →
Java medium

Can finally block be used without catch?

Topic: General Read →
Java medium

Can i import same package/class twice?

Topic: General Read →
Java medium

Can overloaded methods be override too?

Topic: General Read →
Java medium

Can static block throw exception?

Topic: General Read →
Java medium

Can the method local inner class object access method's local variables?

Topic: General Read →
Java medium

Can there be an abstract class with no abstract methods in it?

Topic: General Read →
Java medium

Can this keyword be assigned null value?

Topic: General Read →
Java medium

Can try statements be nested?

Topic: General Read →
Java medium

Can we achieve runtime polymorphism by data members?

Topic: General Read →
Java medium

Can we create an object for an interface?

Topic: General Read →
Java medium

Can we declare a class static?

Topic: General Read →
Java medium

Can we declare an abstract method private?

Topic: General Read →
Java medium

Can we declare an interface method static?

Topic: General Read →
Java medium

Can we declare interface method's private?

Topic: General Read →
Java medium

Can we declare interface methods as private?

Topic: General Read →
Java medium

Can we declare main method as final?

Topic: General Read →
Java medium

Can we have abstract methods in a class which is not Abstract?

Topic: General Read →
Java medium

Can we have an abstract class without abstract methods?

Topic: General Read →
Java medium

Can we have the try block without catch block?

Topic: General Read →
Java medium

Can we instantiate an abstract class?

Topic: General Read →
Java medium

Can we instantiate an interface?

Topic: General Read →
Java medium

Can we instantiate the object of derived class if parent constructor is protected?

Topic: General Read →
Java medium

Can we make an object final i.e immutable using final keyword?

Topic: General Read →
Java medium

Can we make constructor final?

Topic: General Read →
Java medium

Can we overload constructors?

Topic: General Read →
Java medium

Can we overload main method?

Topic: General Read →
Java medium

Can we override main method?

Topic: General Read →
Java medium

Can we override static methods?

Topic: General Read →
Java medium

Can we put more than one main class in a single java file?

Topic: General Read →
Java medium

Can we put more than one main method in single class?

Topic: General Read →
Java medium

Can we put more than one public class in single java file?

Topic: General Read →
Java medium

Can we reduce the visibility of the "overridden" method?

Topic: General Read →
Java medium

Can we use both "this" and "super" in a constructor?

Topic: General Read →
Java medium

Can you call one constructor from another if a class has multiple constructors?

Topic: General Read →
Java medium

Define class?

Topic: General Read →
Java medium

Define composition?

Topic: General Read →
Java medium

Define JIT compiler?

Topic: General Read →
Java medium

Define Packages in Java?

Topic: General Read →
Java medium

Difference between Abstract and Concrete Class?

Topic: General Read →
Java medium

Difference between boolean and Boolean?

Topic: General Read →
Java medium

Difference between C++ and Java?

Topic: General Read →
Java medium

Difference between class and objects?

Topic: General Read →
Java medium

Difference between implicit and explicit type casting?

Topic: General Read →
Java medium

Difference between loadClass and Class.forName?

Topic: General Read →
Java medium

Difference between Overloading and Overriding?

Topic: General Read →
Java medium

Difference between Private , Public and Protected?

Topic: General Read →
Java medium

Difference between protected and default Modifier?

Topic: General Read →
Java medium

Difference between serializable and externalizable interface?

Topic: General Read →
Java medium

Different types of memory used by JVM?

Topic: General Read →
Java medium

Do interfaces have member variables?

Topic: General Read →
Java medium

Does all property of immutable object needs to be final?

Topic: General Read →
Java medium

Does constructor returns any value?

Topic: General Read →
Java medium

Does it matter in what order catch statements for FileNotFoundException and IOException are written?

Topic: General Read →
Java medium

Does Java support multiple inheritence?

Topic: General Read →
Java medium

Explain Autoboxing?

Topic: General Read →
Java medium

Explain java.lang.OutOfMemoryError?

Topic: General Read →
Java medium

Explain the different forms of Polymorphism.

Topic: General Read →
Java medium

Explain the import keyword.

Topic: General Read →
Java medium

Explain the usage of this() with constructors?

Topic: General Read →
Java medium

Explain the use of "Native" keyword?

Topic: General Read →
Java medium

Explain the working of JVM.

Topic: General Read →
Java medium

Give a brief history of Java.

Topic: General Read →
Java medium

Give an example of immutable class?

Topic: General Read →
Java medium

How are this() and super() used with constructors?

Topic: General Read →
Java medium

How can we make sure that a code segment gets executed even in case of uncatched exceptions?

Topic: General Read →
Java medium

How can we make the object immutable?

Topic: General Read →
Java medium

How do you prevent a method from being overridden?

Topic: General Read →
Java medium

How does Java implement polymorphism?

Topic: General Read →
Java medium

How does the Java default constructor be provided?

Topic: General Read →
Java medium

How is java platform independent?

Topic: General Read →
Java medium

How Java enabled High Performance?

Topic: General Read →
Java medium

How many bits are used to represent Unicode, ASCII, UTF-16, and UTF-8 characters?

Topic: General Read →
Java medium

How to create custom exceptions?

Topic: General Read →
Java medium

How to invoke a superclass version of an Overridden method?

Topic: General Read →
Java medium

If a method is declared as protected, where may the method be accessed?

Topic: General Read →
Java medium

If a variable is declared as private, where may the variable be accessed?

Topic: General Read →
Java medium

If System.exit (0); is written at the end of the try block, will the finally block still execute?

Topic: General Read →
Java medium

If you compile a file containing inner class how many .class files are created and what are all of them accessible in usual way?

Topic: General Read →
Java medium

Is constructor inherited?

Topic: General Read →
Java medium

Is it necessary that each try block must be followed by a catch block?

Topic: General Read →
Java medium

Is Java Compiled or an Interpreted language?

Topic: General Read →
Java medium

Is Java purely Object Oriented? Explain.

Topic: General Read →
Java medium

Is JVM, a compiler or interpretor?

Topic: General Read →
Java medium

Is main a keyword in Java?

Topic: General Read →
Java medium

Is that the only way to initialize the object in that case?

Topic: General Read →
Java medium

Is there any limitation of using Inheritance?

Topic: General Read →
Java medium

Is there any need to import java.lang package?

Topic: General Read →
Java medium

List any five features of Java?

Topic: General Read →
Java medium

List primitive Java types?

Topic: General Read →
Java medium

List the three steps for creating an Object for a class?

Topic: General Read →
Java medium

List two Java IDE's?

Topic: General Read →
Java medium

Name few Java marker interfaces?

Topic: General Read →
Java medium

Name Wrapper classes available for primitive types?

Topic: General Read →
Java medium

Property Class?

Topic: General Read →
Java medium

runnable a Marker interface?

Topic: General Read →
Java medium

Variable of the boolean type is automatically initialized as?

Topic: General Read →
Java medium

What are disadvantages of using inner classes?

Topic: General Read →
Java medium

What are packages?

Topic: General Read →
Java medium

What are the advantages of Inner classes?

Topic: General Read →
Java medium

What are the advantages of using exception handling?

Topic: General Read →
Java medium

What are the design considerations while making a choice between using interface and abstract class?

Topic: General Read →
Java medium

What are the different class loaders used by JVM?

Topic: General Read →
Java medium

What are the different types of inner classes?

Topic: General Read →
Java medium

What are the different ways to handle exceptions?

Topic: General Read →
Java medium

What are the principle concepts of OOPS?

Topic: General Read →
Java medium

What are the types of Exceptions in Java

Topic: General Read →
Java medium

What are wrapper classes?

Topic: General Read →
Java medium

What class of exceptions are generated by the Java run-time system?

Topic: General Read →
Java medium

What Design pattern Wrapper Classes implement?

Topic: General Read →
Java medium

What do you mean by Access Modifier?

Topic: General Read →
Java medium

What do you mean by object?

Topic: General Read →
Java medium

What do you mean by return type Void?

Topic: General Read →
Java medium

What environment variables do I need to set on my machine in order to be able to run Java programs?

Topic: General Read →
Java medium

What if there is a break or return statement in try block followed by finally block?

Topic: General Read →
Java medium

What is a class file?

Topic: General Read →
Java medium

What is a Class Loader?

Topic: General Read →
Java medium

What is a Class Variable

Topic: General Read →
Java medium

What is a Final variable?

Topic: General Read →
Java medium

What is a Instance Variable

Topic: General Read →
Java medium

What is a Local Variable

Topic: General Read →
Java medium

What is a marker interface?

Topic: General Read →
Java medium

What is a nested interface?

Topic: General Read →
Java medium

What is a Static import?

Topic: General Read →
Java medium

What is a strictfp modifier?

Topic: General Read →
Java medium

What is a transient variable?

Topic: General Read →
Java medium

What is a WAR file?

Topic: General Read →
Java medium

What is Abstraction?

Topic: General Read →
Java medium

What is an abstract class?

Topic: General Read →
Java medium

What is an exception?

Topic: General Read →
Java medium

What is an Externalizable interface?

Topic: General Read →
Java medium

What is an Immutable object?

Topic: General Read →
Java medium

What is an inner class?

Topic: General Read →
Java medium

What is an Interface?

Topic: General Read →
Java medium

What is an Object class?

Topic: General Read →
Java medium

What is assert keyword used for?

Topic: General Read →
Java medium

What is Constructor?

Topic: General Read →
Java medium

What is constructor chaining and how is it achieved in Java?

Topic: General Read →
Java medium

What is Default Access?

Topic: General Read →
Java medium

What is difference between abstract class and interface?

Topic: General Read →
Java medium

What is difference between instanceof and isInstance(Object obj)?

Topic: General Read →
Java medium

What is difference between Path and Classpath?

Topic: General Read →
Java medium

What is dot operator?

Topic: General Read →
Java medium

What is Downcasting?

Topic: General Read →
Java medium

What is Encapsulation?

Topic: General Read →
Java medium

What is error?

Topic: General Read →
Java medium

What is exception propogation?

Topic: General Read →
Java medium

What is Externalizable interface?

Topic: General Read →
Java medium

What is final class?

Topic: General Read →
Java medium

What is final keyword?

Topic: General Read →
Java medium

What is immutable object? Can you write immutable object?

Topic: General Read →
Java medium

What is "Import" used for?

Topic: General Read →
Java medium

What is Inheritance?

Topic: General Read →
Java medium

What is JAR file?

Topic: General Read →
Java medium

What is Java Byte Code?

Topic: General Read →
Java medium

What is JDK?

Topic: General Read →
Java medium

What is JRE?

Topic: General Read →
Java medium

What is JVM?

Topic: General Read →
Java medium

What is keyword instanceOf used for?

Topic: General Read →
Java medium

What is Locale?

Topic: General Read →
Java medium

What is method overloading?

Topic: General Read →
Java medium

What is method overriding?

Topic: General Read →
Java medium

What is NullPointerException?

Topic: General Read →
Java medium

What is Polymorphism?

Topic: General Read →
Java medium

What is protected access modifier?

Topic: General Read →
Java medium

What is reflection?

Topic: General Read →
Java medium

What is runtime polymorphism or dynamic method dispatch?

Topic: General Read →
Java medium

What is static block?

Topic: General Read →
Java medium

What is static class?

Topic: General Read →
Java medium

What is "super" used for?

Topic: General Read →
Java medium

What is the default value for Object Reference in Java?

Topic: General Read →
Java medium

What is the default value of an object reference declared as an instance variable?

Topic: General Read →
Java medium

What is the default value of byte datatype in Java?

Topic: General Read →
Java medium

What is the default value of float and double datatype in Java?

Topic: General Read →
Java medium

What is the default value of local variable?

Topic: General Read →
Java medium

What is the difference between a break statement and a continue statement?

Topic: General Read →
Java medium

What is the difference between abstraction and encapsulation?

Topic: General Read →
Java medium

What is the difference between error and an exception?

Topic: General Read →
Java medium

What is the difference between object oriented programming language and object based programming language?

Topic: General Read →
Java medium

What is the difference between static and instance methods?

Topic: General Read →
Java medium

What is the difference throw and throws?

Topic: General Read →
Java medium

What is the GregorianCalendar class?

Topic: General Read →
Java medium

What is the Locale class?

Topic: General Read →
Java medium

What is the primary benefit of Encapsulation?

Topic: General Read →
Java medium

What is the purpose of default constructor?

Topic: General Read →
Java medium

What is the purpose of making an object immutable?

Topic: General Read →
Java medium

What is the purpose of System Class?

Topic: General Read →
Java medium

What is the range of the short type?

Topic: General Read →
Java medium

What is the relation between class file and byte code?

Topic: General Read →
Java medium

What is the SimpleTimeZone class?

Topic: General Read →
Java medium

What is the use of finally block?

Topic: General Read →
Java medium

What is the use of Marker interface if they don't hold anything?

Topic: General Read →
Java medium

What is the use of Volatile Keyword?

Topic: General Read →
Java medium

What is "this" keyword used for?

Topic: General Read →
Java medium

What is type casting?

Topic: General Read →
Java medium

What is volatile keyword?

Topic: General Read →
Java medium

What kind of variables a class can consist of?

Topic: General Read →
Java medium

What modifiers are allowed for methods in an Interface?

Topic: General Read →
Java medium

What restrictions are placed on method overriding?

Topic: General Read →
Java medium

What's the difference between constructors and other methods?

Topic: General Read →
Java medium

What will happen if static modifier is removed from the signature of the main method?

Topic: General Read →
Java medium

What will happen if we declare a class abstract as well as final?

Topic: General Read →
Java medium

What will happen if we make the constructor private?

Topic: General Read →
Java medium

When a byte datatype is used?

Topic: General Read →
Java medium

When Abstract methods are used?

Topic: General Read →
Java medium

When ArithmeticException is thrown?

Topic: General Read →
Java medium

When is the ArrayStoreException thrown?

Topic: General Read →
Java medium

When parseInt() method can be used?

Topic: General Read →
Java medium

When should I use abstract classes and when should I use interfaces?

Topic: General Read →
Java medium

When super keyword is used?

Topic: General Read →
Java medium

When you declare a method as abstract, can other nonabstract methods access it?

Topic: General Read →
Java medium

Where and how can you use a private constructor?

Topic: General Read →
Java medium

Which are the two subclasses under Exception class?

Topic: General Read →
Java medium

Which arithmetic operations can result in the throwing of an ArithmeticException?

Topic: General Read →
Java medium

Which is superclass of Exception?

Topic: General Read →
Java medium

Which is the super class of all classes in java?

Topic: General Read →
Java medium

Which modifiers can be applied to the method local inner class?

Topic: General Read →
Java medium

Which object oriented Concept is achieved by using overloading and overriding?

Topic: General Read →
Java medium

Who calls the main method in java?

Topic: General Read →
Java medium

Why do member variables have default values whereas local variables don't have any default value?

Topic: General Read →
Java medium

Why Errors are Not Checked?

Topic: General Read →
Java medium

Why inner class can access only final variable?

Topic: General Read →
Java medium

Why is char 2 bytes?

Topic: General Read →
Java medium

Why Java don't use pointers?

Topic: General Read →
Java medium

Why Java is considered dynamic?

Topic: General Read →
Java medium

Why Packages are used?

Topic: General Read →
Java medium

Why Runtime Exceptions are Not Checked?

Topic: General Read →
Java medium

Why static methods cannot access non static variables or methods?

Topic: General Read →