Java Language Interview Question and Answers

36. Describe life cycle of thread?
 
    A thread is similiar to a program that has a single flow of control.A thread is a execution in a program. The life cycle of threads are
  • Newborn state
  • Runnable state
  • Running state
  • Blocked state
  • Dead state
 
Your Name Your Email-ID
Your Answer
37. What is an Applets?
 
  • Applets are small java programs that are primarily used in Internet computing.
  • They can be transported over the internet from one computer to another and run using the Applet Viewer or any web browser that supports java.
 
Your Name Your Email-ID
Your Answer
38 What are wrapped classes?
  Wrapped classes are classes that allow primitive types to be accessed as objects.
 
Your Name Your Email-ID
Your Answer
39. What is the difference between an if statement and a switch statement?
  The if statement is used to select among two alternatives. It uses a boolean expression to decide which alternative should be executed. The switch statement is used to select among multiple alternatives. It uses an int expression to determine which alternative should be executed.s
 
Your Name Your Email-ID
Your Answer
40. What modifiers are allowed for methods in an Interface?
  Only public and abstract modifiers are allowed for methods in interfaces.
 
Your Name Your Email-ID
Your Answer
123456789101112 Page 8 of 12