• +91 9723535972
  • info@interviewmaterial.com

Java Interview Questions and Answers

Java Interview Questions and Answers

Question - 181 : - What are order of precedence and associativity, and how are they used?

Answer - 181 : - Order of precedence determines the order in which operators are evaluated in expressions. Associatity determines whether an expression is evaluated left-to-right or right-to-left

Question - 182 : - When a thread blocks on I/O, what state does it enter?

Answer - 182 : - A thread enters the waiting state when it blocks on I/O.

Question - 183 : - To what value is a variable of the String type automatically initialized?

Answer - 183 : - The default value of a String type is null.

Question - 184 : - What is the catch or declare rule for method declarations?

Answer - 184 : - If a checked exception may be thrown within the body of a method, the method must either catch the exception or declare it in its throws clause.

Question - 185 : - What is the difference between a MenuItem and a CheckboxMenuItem?

Answer - 185 : - The CheckboxMenuItem class extends the MenuItem class to support a menu item that may be checked or unchecked.

Question - 186 : - What is a task's priority and how is it used in scheduling?

Answer - 186 : - A task's priority is an integer value that identifies the relative order in which it should be executed with respect to other tasks. The scheduler attempts to schedule higher priority tasks before lower priority tasks.

Question - 187 : - What class is the top of the AWT event hierarchy?

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

Question - 188 : - When a thread is created and started, what is its initial state?

Answer - 188 : - A thread is in the ready state after it has been created and started.

Question - 189 : - Can an anonymous class be declared as implementing an interface and extending a class?

Answer - 189 : - An anonymous class may implement an interface or extend a superclass, but may not be declared to do both.

Question - 190 : - What is the range of the short type?

Answer - 190 : - The range of the short type is -(2^15) to 2^15 - 1.


NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners