Browse all practice questions for the Java Technical Interview Practice Test. Search by topic, open any question and review its full explanation, then test yourself in the practice quiz.

Java Technical Interview Practice Test course image
More practice questions

These questions are part of the practice quiz. Start practicing

  • Which of the following modifiers can be used with a non-local inner class?
  • What is the primary purpose of the Java Virtual Machine (JVM)?
  • How many classes can a Java class extend?
  • Can an anonymous class extend a class and implement an interface simultaneously?
  • What is the primary difference between a JDK and a JVM?
  • What are local variables in Java?
  • What are pointers in programming?
  • What is true about abstract variables in Java?
  • What happens if an inner class is marked as static?
  • What describes the visibility of instance variables in Java?
  • What is the purpose of the finalize() method in Java?
  • What is Externalizable?
  • Why is the main() method declared as static in Java?
  • Which of the following is true about a do while loop?
  • Which of the following cannot be declared as final?
  • Can you overload methods based solely on their return types?
  • What type of values can the case labels in a switch statement accept?
  • What does the term 'method overloading' refer to?
  • What does encapsulation provide in Java?
  • How is polymorphism best defined in the context of Java?
  • Is it possible for an abstract class to exist without any abstract methods?
  • What does the modifier 'final' signify when applied to a variable in Java?
  • In Java, what are abstract classes used for?
  • What is the only character that cannot be the first character of an identifier in Java?
  • What is a constructor in Java?
  • What value does read() return when it has reached the end of a file?
  • What is a ClassLoader in Java?
  • What is a primary purpose of a Java package?
  • What is the default initialization value for a boolean variable in Java?
  • What is the primary function of numeric promotion in Java?
  • How does Java treat arrays?
  • What is the primary purpose of the `volatile` keyword in Java?
  • What is the main purpose of a package in Java?
  • How does an ArrayList handle its size in Java?
  • What is necessary for developing a Java application?
  • What does the `transient` keyword indicate in Java?
  • Which of the following accurately describes a static inner class?
  • What is the benefit of using immutable objects in Java?
  • What does it mean when a member of a class is declared static?
  • In how many ways can you define a constant in Java?
  • What is a native method in Java?
  • What is the main purpose of downcasting in Java?
  • What is the significance of the Java Naming and Directory Interface (JNDI)?
  • What is required to declare a constant variable in Java?
  • What does polymorphism in Java allow us to do?
  • Which statement about abstract classes is accurate?
  • What is the primary purpose of the Externalizable interface?
  • In Java, which keyword is used to refer to a superclass constructor?
  • What does JDBC stand for?
  • What type does the variable 'out' belong to in Java's System class?
  • Does the order of public and static declaration matter in the main() method?
  • Can a source file contain more than one class declaration?
  • When can an object reference be cast to an interface reference?
  • What does the Java Stream API allow developers to perform?
  • How many primitive data types does Java support?
  • What does platform independence in Java allow developers to do?
  • What does the `this` keyword help to distinguish in a class?
  • What is an ArrayList in Java?
  • In Java, what type of casting is used to convert larger numeric types to smaller ones?
  • Which best describes the purpose of the `final` keyword in Java?
  • What does the `instanceof` operator do in Java?
  • What does overriding a final method in a subclass result in?
  • When does a static block execute in relation to the main method?
  • Can a Byte object be cast to a double value?
  • How does the prefix form of the ++ operator differ from the postfix form?
  • Can static variables be declared inside a method in Java?
  • What is an Enum in Java?
  • What is the Singleton design pattern's main purpose in Java?
  • Which object-oriented concept is achieved by using overloading and overriding?
  • What is a local variable?
  • What will happen if a local variable is not initialized before use?
  • How can you prevent a class from being inherited?
  • Can you declare a static class at the top level in Java?
  • Which statement best describes what a Map is in Java?
  • What is a thread in Java?
  • Which of the following is NOT a restriction on method overriding?
  • What is the impact of declaring a method as final?
  • What distinguishes a public class from a non-public class in Java?
  • When should a method be declared as static?
  • Which of the following is an exception type in Java?
  • How does Java manage integer overflows?
  • What is the result of adding a double value to a String?
  • What is the concept of Java Generics aimed at providing?
  • What is the primary difference between a while statement and a do while statement?
  • What is one restriction of using a static method in Java?
  • What is the primary purpose of the Path variable in an operating system?
  • What is a marker interface?
  • What does it imply when a class is declared as final?
  • What is the range of the short type in Java?
  • What defines an abstract class in Java?
  • Is it mandatory to include a main() method in every Java class?
  • How is an abstract class enforced to provide implementations for its methods?
  • What is the purpose of the `this` keyword in Java?
  • What is the range of the char type in Java?
  • Which of the following is NOT a primitive type in Java?
  • Is 'null' considered a keyword in Java?
  • Which of the following is the most restrictive access modifier in Java?
  • How does the this() keyword function in Java?
  • What distinguishes unchecked exceptions in Java from checked exceptions?
  • How many bits are typically used to represent an ASCII character?
  • How is an interface different from an abstract class in Java?
  • What is the access level of a private variable in Java?
  • What is required when declaring a final variable?
  • What defines a functional interface in Java?
  • Which statement is true about interface variables?
  • Which of the following describes package-private visibility in Java?
  • What is the difference between `==` and `.equals()` in Java?
  • Can an Interface extend another Interface?
  • What characterizes an abstract class in Java?
  • What will happen if a class implementing an interface provides implementation for some but not all methods?
  • Can we define private and protected modifiers for variables in interfaces?
  • What is the role of Java Garbage Collection?
  • Is Java considered a pure object-oriented language?
  • What is a benefit of importing specific classes instead of entire packages?
  • What restriction applies to method overloading in Java?
  • How does a Java static inner class behave?
  • What is the difference between `Runnable` and `Thread` in Java?
  • If a method is declared as protected, where may it be accessed?
  • Which build tool is commonly used with Java applications?
  • What does "Java Synchronization" help prevent?
  • Are Java Virtual Machines platform independent?
  • What is the significance of static variables in Java?
  • Which of the following best describes a lightweight subprocess in Java?
  • Why does Java not support operator overloading?
  • What are Java assertions primarily used for?
  • Which of the following statements about local variables is correct?
  • What is a member variable?
  • Do subclasses inherit constructors from their superclasses in Java?
  • What distinguishes a LinkedList from an ArrayList?
  • What does the Java memory model define?
  • What is the primary difference between a List and a Set in Java?
  • What is the nature of the sizeof operator in Java?
  • What is an abstract method?
  • Which of the following is an example of polymorphism in Java?
  • Are true and false considered keywords in Java?
  • What is a package in Java?
  • What are assert statements used for in Java?
  • What characteristic is unique to interfaces compared to classes?
  • What modifiers are allowed for methods in an interface?
  • Can an interface itself be declared as final?
  • What is the base class of all Java classes?
  • Where must a package statement be located in a Java source code file?
  • When using the >> operator, what happens to the sign bit in a right shift operation?
  • What is the default access modifier in Java?
  • What is the Java Collections Framework?
  • What is the purpose of a `try-catch` block in Java?
  • What is the function of a transient variable in Java?
  • What is the function of a Java Virtual Machine (JVM)?
  • What is a Java interface?
  • What non-Unicode letter characters can be the first character of an identifier?
  • Can methods inside an interface be declared as final?
  • What does immutability mean in Java?
  • What can be said regarding variable names in Java?
  • In Java, which of the following statements is true about the `Set` interface?
  • Which modifier can be applied to class methods but not to classes themselves?
  • For a class in Java that implements an interface, what must be true about its method implementations?
  • Is it permissible to define a class inside an interface?
  • How can you print a statement before the main method is executed?
  • Which statement is true about checked exceptions in Java?
  • Does Java support multiple inheritance?
  • How does a lambda expression contribute to Java programming?
  • Can a class declared as private be accessed outside its package?
  • Which class is extended by all other classes in Java?
  • Is it possible to declare the main() method as final in Java?
  • Why might a programmer choose to declare a method inside an interface?
  • What is the purpose of the `final` keyword in Java?
  • How is the ternary operator correctly written in Java?
  • Why is operator overloading discouraged in Java?
  • What could happen if synchronization is not used in a multi-threaded environment?
  • What are Java Annotations primarily used for?
  • Can the main() method be overloaded in Java?
  • If a class is declared without access modifiers, what type of access does it have?
  • Which method of a class can be declared protected?
  • What best describes an exception in Java?
  • Describe the `static` keyword in Java.
  • In which situation is a method considered native?
  • Which modifiers can be used with a local inner class?
  • What is a key feature of the Java programming language?
  • In Java, what happens to byte, char, and short values during numeric promotion?
  • What are the legal operands of the instanceof operator?
  • What is the relationship between method overriding and method access?
  • What is a lambda expression in Java primarily used for?
  • What is a class variable?
  • What is a marker interface in Java?
  • What is the main advantage of using interfaces in Java?
  • What is the purpose of the `native` keyword in Java?
  • If a class implements an interface but does not provide implementation for all of its declared methods, what must happen?
  • In which way do the >> and >>> operators differ?
  • Which of the following numeric types has the largest range in Java?
  • What is the key difference between StringBuilder and StringBuffer?
  • What is a key characteristic of a field variable?
  • Which of the following best describes a Java package?
  • What does the % operator do in Java?
  • Which two concepts determine the evaluation of expressions in Java?
  • What is the function of the `super` keyword in Java?
  • What happens if you try to override a final method in a subclass?
  • In which scenario is declaring a variable as final useful?
  • What does concurrency refer to in Java?
  • Which package is imported by default in Java?
  • Which of the following is true about method declarations in interfaces?
  • Which of the following defines Java's approach to memory management?
  • Which of the following statements about a non-public class is true?
  • When would you typically use lambda expressions in Java?
  • What is a build tool in Java?
  • What is method overriding in Java?
  • Which of the following best describes a constructor in Java?
  • What is an object’s lock in Java?
  • What type of argument does the main() method accept in Java?
  • What happens if you declare an abstract class as final?
  • Why doesn't Java support pointers?
  • What is the purpose of the `throws` keyword in Java?
  • What differentiates an inner class from a nested class?
  • What does order of precedence determine in Java expressions?
  • What does the static keyword indicate when used with methods and blocks of code?
  • What is the return type of a program’s main() method?
  • What defines a Java outer class?
  • Which keyword is used to prevent a class from being subclassed in Java?
  • Which type of data structure does Java Collections Framework provide?
  • What does the `final` keyword indicate when applied to a variable in Java?
  • What happens if two methods have the same name and argument list but different return types?
  • How does Java achieve platform independence?
  • Which character types can be used after the first character of an identifier?
  • What is meant by casting in Java?
  • Which of the following is NOT a principle of Object-Oriented Programming in Java?
  • Which keyword allows the use of a superclass constructor?
  • Why would a programmer declare a variable as transient?
  • Which of the following features does Java NOT support?
  • What is method overloading in Java?
  • What happens to the fractional part of the result in integer division?
  • What is the return type of the main() method in Java?
  • Which of the following statements is true about the main() method?
  • Which of the following is a final class in Java?
  • Which of the following cannot be an abstract class?
  • Can an abstract class be declared as final?
  • What is the role of the `synchronized` keyword in Java?
  • How does an abstract class differ from an interface in Java?
  • What happens if a method is declared both abstract and final?
  • What restrictions are placed on the values of each case of a switch statement?
  • What value does a newly declared boolean variable hold by default in Java?
  • How does an if statement differ from a switch statement in Java?
  • What kind of types does Java include?
  • Why can an Interface extend multiple interfaces but a Class cannot extend multiple classes?
  • What does method overriding achieve in Java?
  • Which access modifier allows visibility to a derived class in a different package?
  • What is the primary difference between a static and a non-static inner class?
  • Which primitive type is used to represent true/false values in Java?
  • What role does the Java Development Kit (JDK) play?
  • When does the compiler supply a default constructor for a class?
  • What signifies that a variable in Java is a constant?
  • What is the access scope of a protected method?
  • What type of collection allows duplicate elements in Java?
  • Can you instantiate an abstract class in Java?
  • What keyword is used to import Java classes into another class?
  • Which modifiers can be used with a top-level class in Java?
  • Can an interface be defined inside a class?
  • When can you use the instanceof operator?
Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy