Static member class is a class defined inside outer class with static modifier EX: Class A { //top level class or outer class static class B { //static member class } }
Correct Answer: The wait(), notify(), and notifyAll() methods are used to provide an efficient way for threads to wait for a shared resource When a thread executes an object's wait() method, it enters the waiting state It only enters the ready state after another thread invokes the object's notify() or notifyAll() methods
Correct Answer: With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources Without synchronization, it is possible for one thread to modify a shared object while another thread is in the process of using or updating that object's value This often leads to significant errors
Correct Answer: Non-static member class is a class defined inside outer class with out static modifier EX: class A { // top level class or outer class class B { //non-static member class } }
Correct Answer: Local class is class defined inside method EX; class A { // top level class public static void main(string[] args) { class B { // local class } } }
Correct Answer: new ClassName(); This expression creates object in heap area and returns that obj address Here JVM creates object but JVM does not returns object original address JVM returns duplicate address, duplicate address is also called as hashcode