Sei sulla pagina 1di 2

Java Program List

1. Write a java program for showing the diffrence between following operators: (i) & and && (logical operators) (ii) | and || (logical operators) (iii) >>,>>> & << (bitwise operators)

2. Write a program to create a Room class, the attributes of this class is roomno,roomtype roomlength,roomheight & roomwidth. And the member functions are setData() ( to set the value of the parameters) displayRoomInfo() (to display the roomno & its type) and volume() (which return the volume of the room). In a class Test find the room information and its volume. 3. Consider the Room class defined above and use constructor in place of setData() to intialize the attributes and In a class Test find the room information and its volume. 4. Write a java program for creating a class Triangle and implement two overloaded functions area(int height,int base) and area(int side1,int side2,int side3). 5. Write a program for multilevel and hierarchical inheritance and show how the constructer calling is performed in multilevel hierarchy? 6. Write a program to create an abtract class named Shape having attribute colour and name and two abstract methods area() and paremeter() and one concreat method displayInf() ( to display color and name attrubute). For Shape class we have three sub classes Circle, Triangle and Square each of them are implementing area() and paremeter(). In this class hierarchy use the concept of dynamic method dispatching for displaying the displayInf(), area() and paremeter. 7. Write a program for Interface. 8. Write a program for implementing the concept of multiple inheritance(virtually) by using interfaces. 9. Write java programs for creating packages and importing them in such a way that you can use various acess specifiers. 10. Write a java program which demonstrate the use of try,catch, and finally block. 11. Write a java program for demonstrate the diffrence between throw and throws keywords. 12. Write a program to implement a linear queue in which elements are added into one side and deleted from another side (First in First out behavior) by integer array with following exception handling condition. If you are adding elements QueueOverFlowException and If you are deleting elements QueueUnderFlowException and and queue queue is is full empty then then there there will will throw throw

There should be an exception called QueueException that can handle both exception throws above. For all these exceptions appropriate messages should be printed and these are the user defined exceptions.
13. Create three threads by extending Thread class and runnable interface.

Write a program for consumer producer problem. 14. Write a program to show how synchronized methods and objects monitors are used to coordinate access to a common object by multiple threads. 15. methods.Write a program for showing the use of methods defined by InetAddress class. 16. Write a program to create a text file in the path c:\java\abc.txt and check whether that file is exists. Using the command exists(), isDirectory(),isFile(), getName() and getAbsolutePath().If the file exist then copy the contents of file into another file. 17. Write a java program to create a TCP/IP Client and Server. Where client send a request contaning the redius of a triangle and server respond with area of that triangle. 18. Write a Applet program that automatically display the text with Font Style, Font type. 19. Construct AWT window to perfor the following operations on student record with the help of JDBC. The operations are (1) Add new record (2) Reset (3) Next (4) Previous (5) Delete (6) Update (7) Modify .