0% found this document useful (0 votes)
20 views2 pages

Java Question Bank

important quetions
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views2 pages

Java Question Bank

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

QUESTION BANK

1. Write a Java program to implement multilevel inheritance with 3 levels of


hierarchy.
2. Explain how an interface is used to achieve multiple Inheritances in Java.
3. Explain the method overriding with a suitable example.
4. What is single-level inheritance? Write a Java program to implement
single-level
inheritance.

5. What is the importance of the super keyword in inheritance? Illustrate with a


suitable example.

6. What is abstract class and abstract method? Explain with an example.

7. Define package. Explain the steps involved in creating a user-defined


package with an example.

8. Write a program that contains one method that will throw an


IllegalAccessException and use proper exception handles so that the exception
should be printed.

9. What is multithreading? Write a program to create multiple threads in JAVA.

10. Explain the concept of importing packages in Java and provide an example
demonstrating the usage of the import statement.

11. Demonstrate the working of a nested try block with an example.

12. What do you mean by a thread? Explain the different ways of creating
threads.

13. Explain the Lifecycle of a Thread with a neat diagram.

14. Define interface. Explain the working of interface in Java with example.
16. Define Package? Explain with an example how to create and import
package in Java.

17. Define exception? Explain different mechanism of handling the exceptions


in Java with examples.

18. Explain the concept of importing packages in Java and provide an example
demonstrating the usage of the import statement.
19. Develop a java program to illustrate creation of threads using runnable class
(start method starts each of the newly created threads inside run method. There
is a sleep for suspend the thread for 500 milliseconds).

20. Develop a JAVA program to create an interface Resizable with methods


resizeWidth(int width) and resizeHeight(int height) that allow an object to be
resized. Create a class Rectangle that implements the Resizable interface
and implements the resize
methods.

You might also like