0% found this document useful (0 votes)
40 views1 page

Java Question Bank

Uploaded by

sunita.sheoran14
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views1 page

Java Question Bank

Uploaded by

sunita.sheoran14
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

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.

10.What 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.
11.What 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.
13.Explain packages and its types. Explain import command in Java with an examples.
14.What 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.
15.What 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.
16.Describe 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().
18.What are enumerations? Explain the following methods with an example program.
a. values() and valueOf() ii) ordinal() iii) equals() iv) CompareTo()

20.What is autoboxing and autounboxing? Write a Java program that demonstrates how autoboxing and
unboxing take place in expression in evaluation.
21.What are type wrappers? Explain with a program example the character and numeric type wrappers.

You might also like