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

Java 2

The document is a question bank for Java IAT2 covering various topics such as packages, exception handling, multithreading, and synchronization. It includes questions on creating user-defined packages, handling exceptions, thread creation methods, and inter-thread communication. Additionally, it addresses concepts like auto-boxing, wrapper classes, and thread priorities with examples and explanations.

Uploaded by

sunagar.aids24le
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)
7 views1 page

Java 2

The document is a question bank for Java IAT2 covering various topics such as packages, exception handling, multithreading, and synchronization. It includes questions on creating user-defined packages, handling exceptions, thread creation methods, and inter-thread communication. Additionally, it addresses concepts like auto-boxing, wrapper classes, and thread priorities with examples and explanations.

Uploaded by

sunagar.aids24le
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

JAVA IAT2 QUESTION BANK

1. Define package. Explain the steps involved in creating a user-defined package with an
example.
2. Write a program that contains one method that will throw an IllegalAccessException and
use proper exception handles so that the exception should be printed.
3. Define an exception. What are the key terms used in exception handling? Explain.
4. Explain the concept of importing packages in Java and provide an example demonstrating
the usage of the import statement.
5. How do you create your own exception class? Explain with a program.
6. Demonstrate the working of a nested try block with an example.
7. What do you mean by a thread? Explain the different ways of creating threads.
8. What is the need of synchronization? Explain with an example how synchronization is
implemented in JAVA.
9. Discuss values() and value Of() methods in Enumerations with suitable examples.
10. What is multithreading? Write a program to create multiple threads in JAVA.
11. Explain with an example how inter-thread communication is implemented in JAVA.
12. Explain auto-boxing/unboxing in expressions.
13. How to write custom exceptions in Java? Explain with example.
14. What are different states in life cycle of a thread? Explain with neat diagram.
15. How can we create a Thread in java? Write a program to create a thread using any one
way.
16. Define the following terms in Exception 1. Try 2. Catch 3. Finally 4. Throw 5. Throws
17. What is synchronization in java? Write the difference between method synchronization
and block synchronization.
18. Explain how autoboxing and unboxing work for boolean and character values in Java.
19. What is Inter Thread communication in java? Define the working of wait(), notify() and
notifyAll() methods with example.
20. What is Enum in java? Define the below methods with example. 1. values() 2. valueOf()
3. ordinal()
21. What are Wrapper classes in java? Explain Autoboxing and Unboxing concept with
example.
22. What do you understand about Thread Priority? Write a program to set 7 priorities for
main Thread
23. Write details about the below methods used in multithreading. 1. sleep() , 2. yield(), 3.
join() 4. suspend() 5. resume() 6. stop() 7. getName() 8. isAlive() 9. start() 10. run()

You might also like