Question Bank
.
1. What is Thread? Explain the two ways of creating a Thread in Java
2. Explain the inbuild methods in Thread Class with example.
3. Explain run(),start(),methods of thread with example
4. Explain the different type of Exception in Java.
5. What is an exception? Write the syntax for all the keywords used in Exception.
6. What are the packages and how to import the packages?
7. Explain the states of threads in java
8. What is autoboxing? Write a Java program that demonstrates how autoboxing and unboxing take place
in expression in evaluation.
9. What are enumerations? Explain values() and valueOf() methods with an example program.
[Link] is Thread? Explain the two ways of creating a Thread in Java. OR
a. Write a java program to illustrate thread creation using Runnable interface and Thread class.
[Link] is an exception? With syntax and example, explain exception handling mechanism
in Java.
12. Define Exception. Write a program which contains one method which will throw
IllegalAccessException and use proper exception handlers so that exception should be printed in
the calling function.
[Link] packages and its types. Explain import command in Java with an examples.
[Link] is meant by thread priority? How is it assigned and how to get the thread priority? OR Develop
a program to demonstrate Thread priorities in Java.
[Link] is the need for synchronization? Explain with an example, how synchronization is implemented in Java.
OR .Explain the role of synchronization in producer and consumer problem. OR Write a Java program to
illustrate synchronization using synchronization methods.
[Link] the various levels of access protections available for packages and their implications
with suitable program examples. OR .Explain how variables in interfaces are used. Give examples.
OR What are Interfaces? Explain Interfaces in java.
17. With syntax explain the use of following methods in threads
b. isAlive( ) ii) Join( ) iii) wait() iv) notify() v) notifyAll().
[Link] are enumerations? Explain the following methods with an example program.
a. values() and valueOf() ii) ordinal() iii) equals() iv) CompareTo()
[Link] is autoboxing and autounboxing? Write a Java program that demonstrates how autoboxing and
unboxing take place in expression in evaluation.
[Link] are type wrappers? Explain with a program example the character and numeric type wrappers.