Object Oriented Technology
Java Practical List
1. Write a Java Program find the Area of circle.
2. Write a Java Program that will display Factorial of the given number.
3. Write a Java Program that will display the sum of 1+1/2+1/3…..+1/n.
4. Write a Java Program that will display 25 Prime nos.
5. Write a Java Program that will accept command-line arguments and display the same.
6. Write a Java Program to sort the elements of an array in ascending order.
7. Write a Java Program which will read a text and count all occurrences of a particular word.
8. Write a Java Program which will read a string and rewrite it in the alphabetical order eg. The word “STRING” should be written a “GINRST”.
9. Make an Applet that create two buttons named “Red” and “Blue” when a button is pressed the background color of the applets is set to the color named by the button’s label.
10. Write a Java Applet that create some text fields and text areas to demonstrate features of each..
11. Use a Grid layout class to arrange a few instance of circle canvas.
12. Write any Java Program using new operator.
13. Write a Program to create a List Box and a Text Area. Fill up the List Box with some file names. When user double clicks on any filename of the list box, the file should be opened and its contents should be displayed in the text Area.
14. Create an applet with three text Fields and two buttons add and subtract. User will enter two values in the Text Fields. When the button add is pressed, the addition of the two values should be displayed in the third Text Fields. Same the Subtract button should perform the subtraction operation.
15. Create an applet to display the scrolling text. The text should move from right to left. When it reaches to start of the applet border, it should stop moving and restart from the left. When the applet is deactivated, it should stop moving. It should restart moving from the previous location when again activated.
16. Write a program to create three scrollbar and a label. The background color of the lable should be changed according to the values of the scrollbars (The combination of the values RGB)
17. Create user entry from for student data. User will enter roll no, name, dept and semester. Use combo box for dept. When user clicks on the Insert button all the values should be inserted in the Text Area in a row format for each record.
18. Develop a program that accepts five strings from the user and stored them in a vector. The program should also be able to perform following operations.
• Delete an item from the list
• Add an item at the specified location of the list.
• Add an item at the end of the list.
• Print the contents of the vector
Develop suitable GUI for the program using proper AWT controls and Layout Manager.
19. Create an application with a Text Field, a Text Area and button show. User has to enter the name of the file in the Text Field. When the button show is pressed, the contents of the file should be displayed in the Text Area.
20. Create a Text Field, a button and a list box, User has to enter a number in the Text Field. When user clicks on the button, the arithmetic table for that number should be displayed in the list box. If the user repeats this process the list box should be cleared and refilled by the latest values.
21. Develop a program to write the text “Hello, how are you” to a file “Hello.txt”. Also develop a program to read this file and to display the contents of this file using suitable GUI.
22. Develop and application/appelt with a Menu File and two menu items color and font. The submenu of the menu item color will contain different colors which when selected should change the background of the applet. The submenu of the menu item font should contain the list of fonts. Create a Text Field in the center of the container. When the font is selected from the font list of menu, the Text Field text should be appeared in that font.
23. Develop a Program to create a Text Field, a List Box and two buttons add and delete. User will enter values in the Text Field. When user clicks on the add button the value should be added in the List Box. When user clicks on the delete button, the selected item from the list should be removed.
24. Create an applet to display the co-ordinates of the mouse pointer. The co-ordinates should be changed as and when the mouse pointer change its location.