Wednesday, May 7, 2008

Java Interview Questions 34

166. What method is used to specify a container's layout?
Answer: The setLayout() method is used to specify a container's layout.

167. Which containers use a FlowLayout as their default layout?
Answer: The Panel and Applet classes use the FlowLayout as their default layout.

168. What is thread?
Answer: A thread is an independent path of execution in a system.

169. What is multithreading?
Answer: Multithreading means various threads that run in a system.

170. How does multithreading take place on a computer with a single
CPU?
Answer: 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.

No comments:

Useful Information