What is multithreading? what are the methods for inter-thread communication? what is the class in which these methods are defined?

?Multithreading is the mechanism in which more than one thread run independent of each other within the process. wait (), notify () and notifyAll() methods can be used for inter-thread communication and these methods are in Object class. wait() : When a thread executes a call to wait() method, it surrenders the object lock and … Read more

What is the difference between process and thread?-

Process is a program in execution whereas thread is a separate path of execution in a program. In Java, a process and a thread are both concepts related to concurrent programming, but they have distinct differences. Process: A process is an independent program that runs in its own memory space. Processes are isolated from each … Read more

What is the difference between exception and error?-

?– The exception class defines mild error conditions that your program encounters. Exceptions can occur when trying to open the file, which does not exist, the network connection is disrupted, operands being manipulated are out of prescribed ranges, the class file you are interested in loading is missing. The error class defines serious error conditions … Read more

What is the difference between Array and vector?-

Array is a set of related data type and static whereas vector is a growable array of objects and dynamic. In Java, both arrays and vectors are used to store and manipulate collections of elements. However, there are some key differences between them: Data Type: Array: An array can only store elements of the same … Read more

What is the difference between String and String Buffer

?– a) String objects are constants and immutable whereas StringBuffer objects are not. b) String class supports constant strings whereas StringBuffer class supports growable and modifiable strings. In Java, String and StringBuffer are both classes that represent sequences of characters, but there are key differences between them. Immutability: String: Objects of the String class are … Read more