List of Programs - Java
List of Programs - Java
List of Programs - Java
Write a Java program that displays the roots of a quadratic equation ax^2+bx+c=0.
Calculate discriminent D and basing on the value of D, describe the nature of roots.
1
Write a JAVA program to search for an element in a given list of elements (linear
2
search).
Write a JAVA program to search for an element in a given list of elements using binary
search mechanism.
Write a JAVA program to give the example for ‘this’ operator. And also use the ‘this’
4
keyword as return statement.
Write a JAVA program using String Tokenizer class, which reads a line of integers and
then displays each integer and the sum of all integers.
5
Write a JAVA program to give the example for ‘super’ keyword.
Write a JAVA program for example of try and catch block. In this check whether the
7
given array size is negative or not.
Write a JAVA program to illustrate sub class exception precedence over base class.
Write a JAVA program to illustrate creation of threads using runnable interface (start
method start each of the newly created thread. Inside the run method there is sleep() for
suspend the thread for 500 milliseconds).
8
Write a JAVA program to create a class MyThread in this class a constructor, call the
base class constructor, using super and starts the thread. The run method of the class
starts after this. It can be observed that both main thread and created child thread are
executed concurrently.
Write a JAVA program to create a package named pl, and implement this package in Ex
9
class.
Write a JAVA program to create a package named mypack and import it in Circle class
Write a JAVA program to create an abstract class named Shape, that contains an empty
method named numberOfSides ().Provide three classes named Trapezoid, Triangle and
Hexagon, such that each one of the classes contains only the method numberOfSides (),
that contains the number of sides in the given geometrical figure.
10
Write a JAVA program that displays number of characters, lines and words in a text file.
12
Write a JAVA program that allows user to draw lines, rectangles and ovals.