Java Programs


1. Preparing and practice – Installation of Java software, study of any Integrated development environment, sample programs on operator precedence and associativity, class and package concept, scope concept, control structures, constructors and destructors. Learn to compile, debug and execute java programs.
2. Write Java program(s) on use of inheritance, preventing inheritance using final, abstract classes.
3. Write Java program(s) on dynamic binding, differentiating method overloading and overriding.
4. Write Java program(s) on ways of implementing interface.
5. Write a program for the following
6. Develop an applet that displays a simple message.
7. Develop an applet for waving a Flag using Applets and Threads.
8. Write Java program(s) which uses the exception handling features of the language, creates exceptions and handles them properly, uses the predefined exceptions, and create own exceptions  
9. Write java program that inputs 5 numbers, each between 10 and 100 inclusive. As each number is read display it only if it’s not a duplicate of any number already read. Display the complete set of unique values input after the user enters each new value.
10. Write Java program(s) on creating multiple threads, assigning priority to threads, synchronizing threads, suspend and resume threads
11. 10) Write a java program to split a given text file into n parts. Name each part as the name of the original file followed by .part<n> where n is the sequence number of the part file.
12. Write a java program to create a super class called Figure that receives the dimensions of two dimensional objects. It also defines a method called area that computes the area of an object. The program derives two subclasses from Figure. The first is Rectangle and second is Triangle. Each of the sub classes override area() so that it returns the area of a rectangle and  triangle respectively.
13. Write a Java program that creates three threads. First thread displays “Good Morning” every one second, the second thread displays “Hello” every two seconds and the third thread displays “Welcome” every three seconds
14. Design a simple calculator which performs all arithmetic operations. The interface should look like the calculator application of the operating system. Handle the exceptions if any.
15. Write a java program to handle mouse events
16. Write a java program to handle keyboard events
17. Write a java program that allows conduction of object type examination containing multiple choice questions, and true/false questions. At the end of the examination when the user clicks a button the total marks have to be displayed in the form of the message.
18. Write a java program that creates menu which appears similar to the menu of notepad application of the Microsoft windows or any editor of your choice.
19. Write a java program that creates dialog box which is similar to the save dialog box of the Microsoft windows or any word processor of your choice.
20. Write a Java program that correctly implements producer consumer problem using the concept of inter thread communication
21. Write a java program to find and replace pattern in a given file.
22. Use inheritance to create an exception super class called ExceptionA and exception sub classes ExceptionB and ExceptionC, where ExceptionB inherits from ExceptionA and ExceptionC inherits from ExceptionB. Write a java program to demonstrate that the catch block for type ExceptionA catches exception of type ExceptionB and ExceptionC.
23. Write a Java program which opens a connection to standard port on well known server, sends the data using socket and prints the returned data.
24. Write a Java program to create a URLConnection and use it to examine the documents properties and content.
25. Write a Java program which uses TCP/IP and Datagrams to communicate client and server.
26. Create an interface for stack with push and pop operations. Implement the stack in two ways: fixed size stack and Dynamic stack (stack size is increased when stack is full).
27. Create multiple threads to access the contents of a stack. Synchronize thread to prevent simultaneous access to push and pop operations.