OOP LAB EXTERNAL
OOP LAB EXTERNAL
BRANCH:CSE DATE:
1. (a) Write a Java program to display the default value of all primitive data types in Java.
(b) Write a Java program that displays the roots of a quadratic equation . Calculate the discriminant
and, based on the value of , describe the nature of the roots.
2. (a) Write a Java program to search for an element in a given list of elements using the Binary
Search mechanism.
(b) Write a Java program to sort a given list of elements using the Bubble Sort technique.
(c) Write a Java program using StringBuffer to delete and remove characters.
3. (a) Write a Java program to implement the class mechanism. Create a class, define methods, and
invoke them inside the main method.
(b) Write a Java program to implement Method Overloading.
(c) Write a Java program to implement Constructors.
(d) Write a Java program to implement Constructor Overloading.
5. (a) Write a Java program that gives an example of the super keyword.
(b) Write a Java program to implement Interfaces.
(c) Write a Java program that demonstrates Runtime Polymorphism.
6. (a) Write a Java program that describes the Exception Handling mechanism.
(b) Write a Java program illustrating multiple catch clauses.
(c) Write a Java program for the creation of Java Built-in Exceptions.
(d) Write a Java program for the creation of User-Defined Exceptions.
7. (a) Write a Java program that creates threads by extending the Thread class.The first thread displays
“Good Morning” every 1 second. The second thread displays “Hello” every 2 seconds.The third
thread displays “Welcome” every 3 seconds.(Repeat the same by implementing Runnable.)
(b) Write a program illustrating the use of isAlive() and join().
(c) Write a program illustrating Daemon Threads.
(d) Write a Java program for the Producer-Consumer Problem.
8. (a) Write a Java program that imports and uses user-defined packages.
(b) Without writing any code, build a GUI that displays text in a label and an image in an
ImageView (use JavaFX).
(c) Build a Tip Calculator app using several JavaFX components and learn how to
respond to user interactions with the GUI.