List of Programs - Java

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

List of Programs:

Exercise Name of the Program


Write a JAVA program to display default value of all primitive data types of 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 display the Fibonacci sequence


Write a JAVA program give example for command line arguments.

Write a JAVA program to sort given list of numbers.

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 determine multiplication of two matrices.

3 Write a JAVA program to sort an array of strings

Write a JAVA program to check whether given string is palindrome or not.

Write a JAVA program for call by value and call by reference.

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 to demonstrate static variables, methods, and blocks.

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 that illustrates simple inheritance.


Write a JAVA program to maintain Student Grading Database using multilevel
inheritance. Student is Super class, which contains roll no, name, address. Marks derived
from Student class, which contains subject names and respective marks. Result is
derived from Marks class, which contains total, grade.
6
Write a JAVA program demonstrating the difference between method overloading and
method overriding.
Write a JAVA program demonstrating the difference between method overloading and
constructor overloading.

Write a JAVA program that describes exception handling mechanism.

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 for creation of user defined exception.

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 illustrating multiple inheritance using interfaces.

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 describes the life cycle of an applet.


Write a JAVA program to create a border layout control.
Write a JAVA program to create a grid layout control.
Write a JAVA program to create a simple calculator.
11
Write a JAVA program that displays the x and y position of the cursor movement using
Mouse.

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.

You might also like