JAVA QuestionBank
JAVA QuestionBank
Question Bank
1. Define a class student with int id and string name as data members and a method void
setdata( ). Accept and display the data for five students.
2. Differentiate between method overloading and method overriding.
3. Define a class circle having data members pi and radius. Initialize and display values of data
members also calculate area of circle and display it.
4. Differentiate between class and interface.
5. Define package. How to create user defined package? Explain with example.
6. Define a class employee with data members empid and name and salary. Accept data for
three objects and display it.
7. Write the use of final keyword with respect to inheritance.
UNIT – V
1. Distinguish between java applications and java applet. ( Any two points)
2. Give the syntax of < param > tag to pass parameters to an applet.
3. List the methods of File Input Stream Class.
4. Draw the hierarchy of stream classes.