Select Category 
Java Interview Questions Answers Java Interview Questions Answers Exammaterial. Java Interview Questions Answers Exammaterial. Java Interview Questions Answers Exammaterial. Java Interview Questions Answers Exammaterial. Java Interview Questions Answers Exammaterial. Java Interview Questions Answers Exammaterial. Exammaterial.
What is the purpose of the wait(), notify(), and notifyAll() methods?
Java Interview Questions Answers Java Interview Questions Answers Exammaterial. Java Interview Questions Answers Exammaterial. Java Interview Questions Answers Exammaterial. Java Interview Questions Answers Exammaterial. Java Interview Questions Answers Exammaterial. Java Interview Questions Answers Exammaterial. Exammaterial.
The wait(),notify(), and notifyAll() methods are used to provide an efficient way for threads to communicate each other.
Java Interview Questions Answers Exammaterial. Java Interview Questions Answers Exammaterial. Java Interview Questions Answers Exammaterial. Java Interview Questions Answers Exammaterial. Java Interview Questions Answers Exammaterial. Java Interview Questions Answers Exammaterial. Java Interview Questions Answers Exammaterial. Java Interview Questions Answers Exammaterial. Java Interview Questions Answers Exammaterial. Java Interview Questions Answers Exammaterial. Java Interview Quest
Java Interview Questions Answers Exammaterial.  Java Interview Questions Answers Exammaterial.  Java Interview Questions Answers Exammaterial.  Java Interview Questions Answers Exammaterial.  Java Interview Questions Answers Exammaterial.  Java Interview Questions Answers Exammaterial.  Java Interview Questions Answers Exammaterial.&nb
 

Java Interview Questions Answers

Java Interview Question - 16 : -

What is the purpose of the wait(), notify(), and notifyAll() methods?

Java Interview Answer - 16 : -

The wait(),notify(), and notifyAll() methods are used to provide an efficient way for threads to communicate each other.
 

Java Interview Question - 17 : -

What are the Object and Class classes used for?

Java Interview Answer - 17 : -

The Object class is the highest-level class in the Java class hierarchy. The Class class is used to represent the classes and interfaces that are loaded by a Java program.
 

Java Interview Question - 18 : -

What class allows you to read objects directly from a stream?

Java Interview Answer - 18 : -

The ObjectInputStream class supports the reading of objects from input streams.
 

Java Interview Question - 19 : -

Can a lock be acquired on a class?

Java Interview Answer - 19 : -

Yes, a lock can be acquired on a class. This lock is acquired on the class's Class object.
 

Java Interview Question - 20 : -

What is the difference between a Window and a Frame?

Java Interview Answer - 20 : -

The Frame class extends Window to define a main application window that can have a menu bar.
 

Java Interview Question - 21 : -

Can we use System.arraycopy() method to copy the same array?

Java Interview Answer - 21 : -

Yes, you can. The source and destination arrays can be the same if you want to copy a subset of the array to another area within that array.
 

Java Interview Question - 22 : -

Does the code in finally block get executed if there is an exception and a return statement in a catch block?

Java Interview Answer - 22 : -

If an exception occurs and there is a return statement in catch block, the finally block is still executed. The finally block will not be executed when the System.exit(1) statement is executed earlier or the system shut down earlier or the memory is used up earlier before the thread goes to finally block.
 

Java Interview Question - 23 : -

Can one create a method which gets a String and modifies it?

Java Interview Answer - 23 : -

No. In Java, Strings are constant or immutable; their values cannot be changed after they are created, but they can be shared. Once you change a string, you actually create a new object. For example:
String s = "abc"; //create a new String object representing "abc"
s = s.toUpperCase(); //create another object representing "ABC"
 

Java Interview Question - 24 : -

What is the purpose of the System class?

Java Interview Answer - 24 : -

The purpose of the System class is to provide access to system resources.
 

Java Interview Question - 25 : -

How can a GUI component handle its own events?

Java Interview Answer - 25 : -

A component can handle its own events by implementing the required event-listener interface and adding itself as its own event listener.
 

Java Interview Question - 26 : -

What are the drawbacks of inheritance?

Java Interview Answer - 26 : -

Since inheritance inherits everything from the super class and interface, it may make the subclass too clustering and sometimes error-prone when dynamic overriding or dynamic overloading in some situation. In addition, the inheritance may make peers hardly understand your code if they don't know how your super-class acts and add learning curve to the process of development.
Usually, when you want to use a functionality of a class, you may use subclass to inherit such function or use an instance of this class in your class. Which is better, depends on your specification.
 

Java Interview Question - 27 : -

What's the main difference between a Vector and an ArrayList?

Java Interview Answer - 27 : -

Java Vector class is internally synchronized and ArrayList is not.
 

Java Interview Question - 28 : -

What is the difference between Swing and AWT components?

Java Interview Answer - 28 : -

AWT components are heavy-weight, whereas Swing components are lightweight. Heavy weight components depend on the local windowing toolkit. For example, java.awt.Button is a heavy weight component, when it is running on the Java platform for Unix platform, it maps to a real Motif button.
 

Java Interview Question - 29 : -

What class is the top of the AWT event hierarchy?

Java Interview Answer - 29 : -

The java.awt.AWTEvent class is the highest-level class in the AWT event-class hierarchy.
 

Java Interview Question - 30 : -

Is there any other way that you can achieve inheritance in Java?

Java Interview Answer - 30 : -

There are a couple of ways. As you know, the straight way is to "extends" and/or "implements". The other way is to get an instance of the class to achieve the inheritance. That means to make the supposed-super-class be a field member. When you use an instance of the class, actually you get every function available from this class, but you may lose the dynamic features of OOP