OOPJ Practicals GTU
OOPJ Practicals GTU
Assignment 2
1) Write a java programme to input a number and check it's odd or even.
2) Write a java programme that finds Maximum out of two numbers.
3) Write a java programme that finds Minimum out of three numbers.
4) Write a java programme that calculate Percentage and Grade if three subject’s marks are
given.
5) Write a java programme that calculate Percentage and Grade if three subject's marks are
given using Switch case.
6) Write a java programme that do the sum of 1 to 10 numbers using while loop.
7) Write a java programme that that check given number is Prime or not.
8) Write a java programme that check if the given number is Armstrong or not.
9) Write a java programme that perform sum of digits given by the number.
10) Write a java programme that print following triangle using loop.
1
12
123
1234
Assignment 3
1) Write a java programme that input the ten numbers and perform the sum of ten numbers.
2) Write a java programme that find Maximum out of ten number.
3) Write a java programme that check whether searching number is present inside array or not.
4) Write a java programme that do the Matrix addition with 3x3 matrix size.
5) Write a java programme that do the Matrix multiplication with 3x3 matrix size
6) Write a java programme that demonstrate the judged array.
7) Write a java programme to find the Length of string and print second half of string.
8) Write a java programme to find the given string is palindrome or not.
9) Write a java programme that input a line and check how many vowels and consonant.
10) Write a java programme that input a line and count the number of word in the line.
11) Write a java programme that input a paragraph and count number of words in a paragraph.
12) Write a java programme that print following pyramid for the given string.
c
co
com
comp
compu
comput
compute
computer
Assignment 4
1) Write a java programme to demonstrate the use of recursion using factorial function.
2) Write a java programme to demonstrate the use of call by value & call by reference using
swap function.
3) Write a java programme to demonstrate the use of Constructor overloading.
4) Write a java programme to demonstrate the use of Method overloading.
5) Write a java programme to demonstrate the use of Abstract class.
6) Write a java programme to demonstrate the use of Inner class & anonymous inner class.
7) Write a java programme to demonstrate the use of Static keyword.
Assignment 5
Assignment 6
1) Write a java programme that create ‘Divide by Zero’ exception & handle it.
2) Write a java programme to demonstrate the use of Nested try statement.
3) Write a java programme to demonstrate the use of throw keyword.
4) Write a java programme to demonstrate the use of throws keyword.
5) Write a java programme to demonstrate the use of number format exception & array index
out of bound exception.
6) Write a java programme to demonstrate the use of thread using thread class and runnable
interface.
7) Write a java programme to demonstrate the use of wait, notify & notify-all method.
8) Write a java programme to demonstrate the use of Synchronize method in thread.
Assignment 7
1) Write a java programme that read the file name from user through the command line
argument & display the content of file in console.
2) Write a java programme to check whether the name is given from command line or not and
also print the size of file with content.
3) Write a java programme that copy one file and convert it to another file.
4) Write a java programme for the chat application using TCP protocol.
5) Create a class called student, write student management programme to manipulate student
information.
6) Create a class called student, write student management programme to manipulate student
information by using File input-stream & File output-stream.
7) Create a class called student, write student management programme to manipulate student
information by using Buffer reader & Buffer writer class.
Assignment 8