• +91 9971497814
  • info@interviewmaterial.com

Computer Interview Questions Answers

Java Interview Questions Answers

Question - 71 : - How to check two arrays to see if contents have the same types and contain the same elements?

Answer - 71 : - One of options is to use the equals() method of Arrays class. Arrays.equals(a, b); If the array types are different, a compile-time error will happen.

Question - 72 : - What is the immediate superclass of the Dialog class?

Answer - 72 : - Window.

Question - 73 : - Can you call one constructor from another if a class has multiple constructors?

Answer - 73 : - Yes. Use this() syntax.

Question - 74 : - Does garbage collection guarantee that a program will not run out of memory?

Answer - 74 : - No, it doesn't. It is possible for programs to use up memory resources faster than they are garbage collected. It is also possible for programs to create objects that are not subject to garbage collection.

Question - 75 : - What is the difference between the Font and FontMetrics classes?

Answer - 75 : - The FontMetrics class is used to define implementation-specific properties, such as ascent and descent, of a Font object

Question - 76 : - What classes of exceptions may be caught by a catch clause?

Answer - 76 : - A catch clause can catch any exception that may be assigned to the Throwable type. This includes the Error and Exception types.

Question - 77 : - What's the difference between the methods sleep() and wait()

Answer - 77 : - The code sleep(1000); puts thread aside for exactly one second. The code wait(1000), causes a wait of up to one second. A thread could stop waiting earlier if it receives the notify() or notifyAll() call. The method wait() is defined in the class Object and the method sleep() is defined in the class Thread.

Question - 78 : - What is the  Vector class?

Answer - 78 : - The Vector class provides the capability to implement a growable array of objects

Question - 79 : - How is it possible for two String objects with identical values not to be equal under the == operator? How are this() and super() used with constructors?

Answer - 79 : - The == operator compares two objects to determine if they are the same objects in memory. It is possible for two String objects to have the same value, but located in different areas of memory.

Question - 80 : - How does multi-threading take place on a computer with a single CPU?

Answer - 80 : - The operating system's task scheduler allocates execution time to multiple tasks. By quickly switching between executing tasks, it creates the impression that tasks execute sequentially.

Computer Contributors

Rajeev Katiyar
Yes Baroda

Share your email for latest updates


Our partners