Java Interview Questions & Answers

Showing 10 of 301 questions | Page 16

Technical interview questions and answers are essential for any Java Interview because Java is one of the most widely used programming languages in software development. Companies expect candidates to know OOP concepts, multithreading, exceptions, JDBC, collections, and real-time coding questions. Java interviews are commonly part of campus placements and software development roles in companies such as TCS, Infosys, Wipro, Cognizant, and Accenture. For freshers and job seekers, understanding Java concepts clearly makes it easier to clear technical rounds, online coding tests, and project discussions. This guide includes the most important and frequently asked Java interview questions with detailed explanations to help you prepare efficiently. These questions will help you gain confidence during software developer interviews and competitive placement tests.

Java professionals should deepen their expertise through J2EE development  concepts and data structures  fundamentals 

Showing 10 of 301 questions

151. Can an object's finalize() method be invoked while it is reachable?

An object's finalize() method cannot be invoked by the garbage collector while the object is still reachable. However, an object's finalize() method may be invoked by other objects.

152. What is the immediate superclass of the Applet class?

Panel

153. What is the difference between preemptive scheduling and time slicing?

Under preemptive scheduling, the highest priority task executes until it enters the waiting or dead states or a higher priority task comes into existence. Under time slicing, a task executes for a predefined slice of time and then reenters the pool of ready tasks. The scheduler then determines which task should execute next, based on priority and other factors.

154. Name three Component subclasses that support painting.

The Canvas, Frame, Panel, and Applet classes support painting.

155. What value does readLine() return when it has reached the end of a file?

The readLine() method returns null when it has reached the end of a file.

156. What is the immediate superclass of the Dialog class?

Window

157. What is clipping?

Clipping is the process of confining paint operations to a limited area or shape.

158. What is a native method?

A native method is a method that is implemented in a language other than Java.

159. Can a for statement loop indefinitely?

Yes, a for statement can loop indefinitely. For example, consider the following: for(;;) ;

160. What are order of precedence and associativity, and how are they used?

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
Questions and Answers for Competitive Exams Various Entrance Test