What is the difference between JDK, JRE, and JVM?
JRE is removed in versions after 11
Explain the concept of OOP in Java. What are its principles?
How does Java handle memory management?
JVM specification and its implementations?
What is the significance of the final keyword in Java?
How does multithreading work in Java?
Why thread pool better to use rather than start threads manually ?
What are Java Streams, and how are they used?
What are terminal operations in stream ?
How to debug streams isn’t it a pain ?
Describe the difference between HashMap and ConcurrentHashMap ?
If we read null in multithread enviroment, doesn’t it mean we have no value there ?
What is the purpose of the volatile keyword in Java?
Does Reentrantlock flushes to RAM directly ?
What is the difference between checked and unchecked exceptions?
Why modern langs avoid checked exceptions ?
How does garbage collection work in Java?
What are functional interfaces in Java?
Why abstract method in java without word abstract ?
What is the difference between Comparator and Comparable?
How does Java implement pass-by-value?
Explain the differences between ArrayList and LinkedList?
What is an immutable object? Provide examples.
How does Java handle exceptions with try-catch-finally?
What is the difference between an interface and an abstract class?
What is the difference between String, StringBuilder, and StringBuffer?
What are method references in Java? How are they used?
What is the purpose of the Optional class in Java?
Explain dynamic method dispatch in Java
What is bound and unbound method references ?
Why we can assign greeting::length to Supplier<Integer>
How does the hashCode() method relate to equals() in Java?
How to write a good hash function ?
What is the role of class loaders in Java
What is the difference between public, protected, default, and private access modifiers?
Explain the use of annotations in Java. Provide examples.
Provide example where we need source retention
If i don’t add @Override annotation will method be overrided ?
Provide example where we need class retention
What are lambda expressions, and why are they used?
Why lambda work only with functional interfaces ?
How does the Fork/Join framework work in Java?
What is the difference between shallow copy and deep copy in Java?
What are the advantages of using generics in Java?
Explain the purpose of the transient keyword in Java
Explain the difference between Serializable and Externalizable.
What is reflection in Java, and how is it used?
What is the enum type in Java? Provide examples of its use.
What is the role of the Class class in Java?
Why do i know class information in compile time ?
How does ThreadLocal work in Java?
What values are variables initialized to by default ?
Tell me about blocks in Java what are they ?
Why do we need instance blocks if we have constructor ?
Why do we need write smth in parenthesies in synchronized ? why we can’t just type synchronized ?
Provide example where we in some object but syncing another one
What do you know about the main() function?
What logical operations and operators do you know?
What bitwise operations do you know?
Where and for what is the abstract modifier used?
Define the concept of “interface.” What modifiers do interface fields and methods have by default?
Why do some interfaces not define methods at all?
Why can’t you declare an interface method with the final modifier?
What has a higher level of abstraction – a class, an abstract class, or an interface?
Can an object access a private variable of a class? If so, how?
Why are initialization blocks needed, and what types are there?
To which Java constructs is the static modifier applicable?
Why are static initializers used in Java?
What happens if an exception occurs in an initializer?
What exception is thrown when an error occurs in a class initializer?
Can a static method be overridden or overloaded?
Can a Non-Static Method Overload a Static Method?
Can the access level or return type be narrowed when overriding a method ?
Is it possible to declare a method abstract and static at the same time?
What is the difference between a class instance member and a static class member?
What types of classes are there in Java?
What are the features of using nested classes: static and internal?
What is a “local class”? What are its features?
What are “anonymous classes” ? Where are they used ?
How can I access a field of an outer class from a nested class?
What is the assert statement used for ?
What is the garbage collector for?
What types of garbage collectors are implemented in the HotSpot virtual machine ?
Describe the algorithm of any garbage collector implemented in the HotSpot virtual machine.
What is finalize()? Why is it needed?
What is the difference between final, finally, and finalize()?
What is Heap and Stack memory in Java? What is the difference between them?
How are variables passed to methods, by value or by reference?
What is type downgrade and type promotion?
When can a ClassCastException be thrown in an application?
What is autoboxing in Java and what are the rules for boxing primitive types in wrapper classes?
What are the features of the String class?
What are limitations of string pool ?
Why is String an immutable and finalizable class?
What means Hash code is cached, making hash-based collections faster. Where is that cached ?
Why is char[] preferred over String for storing passwords?
Why is String a popular key in HashMap in Java?
What does the intern() method do in the String class?
Can strings be used in a switch statement?
What is the main difference between String, StringBuffer, and StringBuilder?
What is the Object class? What methods does it have?
What is the difference between shallow and deep cloning?
Which cloning method is preferable?
Why is the clone() method declared in the Object class and not in the Cloneable interface?
Define the concept of a “constructor.”
What is a “default constructor”?
What is the difference between default, copy, and parameterized constructors?
Where and how can you use a private constructor?
Explain class loaders and dynamic class loading.
Why do we need equals()? How is it different from the == operation?
Equals() generates an equivalence relation. What properties does such a relation have?
If you want to override equals(), what conditions must be satisfied for the overridden method?
Rules for overriding the Object.equals() method.
What is the relationship between hashCode() and equals()?
If equals() is overridden, are there any other methods that should be overridden?
What happens if you override equals() without overriding hashCode()? What problems might arise?
How are the hashCode() and equals() methods implemented in the Object class?
What is the purpose of the hashCode() method?
Rules for overriding the Object.hashCode() method.
Are there any guidelines on which fields should be used when calculating hashCode()?
Can different objects have the same hashCode()?
Will Points Be Correctly Placed and Retrieved in a HashSet?
Can different objects (ref0 != ref1) have ref0.equals(ref1) == true?
Can different references to the same object (ref0 == ref1) have ref0.equals(ref1) == false?
There is a class Point{int x, y;}. Why is a hash code of the form 31 * x + y preferable to x + y?
Why Do Keys with Different Hash Codes End Up in the Same Bucket in a HashMap?
How does Java handle exceptions with try-catch-finally?
Why Try-with-resources (try with AutoCloseable) is a better alternative to finally for resource
Describe the hierarchy of exceptions
Philosophy behind checked and unchecked exceptions
What types of exceptions in Java do you know, how do they differ?
What is a checked and unchecked exception?
What is the difference between checked and unchecked exceptions?
Which Operator Allows You to Forcibly Throw an Exception in Java?
What does the throws keyword mean?
What are the types of unchecked exceptions?
What do you know about OutOfMemoryError?
Describe the operation of the try-catch-finally block.
What is the try-with-resources mechanism?.
Is it possible to use a try-finally block (without catch)?
Can one catch block catch several exceptions at once?
Is the finally block always executed?
Can the main method throw an exception outside and if so, where will this exception be handled?