Sunteți pe pagina 1din 2

LIST OF PRACTICAL OBJECT ORIENTED PROGRAMMING USING JAVA

1. Write a java program which calculates the size of a given file & then renames that file to another
name.

2. Write a java program to print all primitive data values into a file using FileWriter stream
wrapped with a PrintWriter.

3. Write a program to read text from the keyboard & write the text to a file called junk.txt.

4. Write a java program to calculate the sum of digits of a number. The sum should be calculated
recursively to get a single digit sum. The input should be accepted from command line.( 189 9)

5. Write a java program that enters a string at the command line. If the string is not equal to
MCA then it should throw an exception called NO MATCH.

6. Implement a class programmer. A programmer has name, company name , working for &
basic_salary. Write a default constructor & a constructor with parameters to create a
programmer object. Further show the implementation of the constructor method with
parameters.

7. Write a recursive function in java to print the contents of an array of integers.

8. Write a java program to calculate nCr

Where nCr = n!/(n-r)!(r!).
9. Write a java program to calculate Fibonacci series recursively.
10. Implement a student class. A student has a name, stipend, enrolment number. Write a default
constructor & a constructor with two parameters (name & enrolment number) & two methods.
a. To return the name & enrolment number.
b. A method that increases the students stipend.
Write a small program that test your class.
11. Write a complete Java program to find out whether the string t1 is contained in the string t. If so
return true or false.
12. Write a java program that reads in an integer & breaks it into a sequence of individual
digits.(1634------- 1 6 3 4)
13. Create a text area with 10 rows & 20 columns. Insert 2 lines into text Area.
14. Write a java program that let the user enter text from text field & then append it to the text
areas.
15. Write a java program to count 1 to 1000 numbers using 10 threads.
16. Write a java program to find the largest & smallest of n numbers stored in an array , where n is a
positive integer.
17. Write a java program to show the use of Grid Layout Manager, Flow Layout Manager, Border
Layout Manager.
18. Write an applet showing string in horizontal direction.
19. Write a program to generate mouse event & keyboard event.
20. Write a program to Display Invert Triangle.
Example:
Input - 5
Output :
5 5 5 5 5
4 4 4 4
3 3 3
2 2
1

S-ar putea să vă placă și