Wednesday 25 April 2012

JAVA interview questions 6

Q51. What is the difference between preemptive schedulingand 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 determineswhich task should execute next, based on priority and other factors. 


Q52 Name three Component subclasses that supportpainting. 
The Canvas, Frame, Panel, and Applet classes support painting. 

Q53. What value does readLine() return when it hasreached the end of a file? 
The readLine() method returns null when it has reached the end of a file. 

Q54. What is the immediate superclass of the Dialog class? 
Window 

Q55. What is clipping? 
Clipping is the process of confining paint operations to a limited area or shape. 

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


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

Q58. What are order of precedence and associativity, andhow 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 

Q59. When a thread blocks on I/O, what state does itenter? 
A thread enters the waiting state when it blocks on I/O. 

Q60. To what value is a variable of the String typeautomatically initialized? 
The default value of a String type is null. 

No comments:

Post a Comment