Java Programs List

Program 1: WAP to find the largest of n natural numbers.

Program 2: WAP to find whether a given number is prime or not.

Program 3: Write a menu driven program for following:
a. Display a Fibonacci series
b. Compute Factorial of a number
c. WAP to check whether a given number is odd or even.
d. WAP to check whether a given string is palindrome or not.

Program 4: WAP to print the sum and product of digits of an Integer and reverse the Integer.

Program 5: Write a program to create an array of 10 integers. Accept values from the user in that array. Input another number from the user and find out how many numbers are equal to the number passed, how many are greater and how many are less than the number passed.

Program 6: Write a program that will prompt the user for a list of 5 prices. Compute the average of the prices and find out all the prices that are higher than the calculated average.

Program 7: Write a program in java to input N numbers in an array and print out the Armstrong numbers from the set.

Program 8: Write java program for the following matrix operations:
a. Addition of two matrices
b. Summation of two matrices
c. Transpose of a matrix
d. Input the elements of matrices from user.

Program 9: Write a java program that computes the area of a circle, rectangle and a Cylinder using function overloading.

Program 10: Write a Java for the implementation of Multiple inheritance using interfaces to calculate the area of a rectangle and triangle.

Program 11: Write a java program to create a frame window in an Applet. Display your name, address and qualification in the frame window.

Program 12: Write a java program to draw a line between two coordinates in a window.

Program 13: Write a java program to display the following graphics in an applet window.
a. Rectangles
b. Circles
c. Ellipses
d. Arcs
e. Polygons

Program 14: Write a program that reads two integer numbers for the variables a and b. If any other character except number (0-9) is entered then the error is caught by NumberFormatException object. After that ex.getMessage() prints the information about the error occurring causes.

Program 15: Write a program for the following string operations:
a. Compare two strings
b. Concatenate two strings
c. Compute length of a string

Program 16: Create a class called Fraction that can be used to represent the ratio of two integers. Include appropriate constructors and methods. If the denominator becomes zero, throw and handle an exception.