0% found this document useful (0 votes)
7 views2 pages

JAVA QuestionBank

The document is a question bank for a Java Programming course, covering topics such as inheritance, interfaces, packages, exception handling, and multithreading. It includes various questions that require definitions, program implementations, and explanations of concepts related to Java. The questions are categorized into units with specified marks for each topic.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

JAVA QuestionBank

The document is a question bank for a Java Programming course, covering topics such as inheritance, interfaces, packages, exception handling, and multithreading. It includes various questions that require definitions, program implementations, and explanations of concepts related to Java. The questions are categorized into units with specified marks for each topic.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Java Programming-22412

Question Bank

UNIT – III – INHERITANCE, INTERFACE AND PACKAGE (4 marks)

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 – IV – EXCEPTION HANDLING AND MULTITHREADING (4 Marks)

1. Explain the two ways of creating threads in Java.


2. Write a program to create two threads. One thread will display the numbers from 1 to 50
(ascending order) and other thread will display numbers from 50 to 1 (descending order).
3. Write a program to input name and salary of employee and throw user defined exception if
entered salary is negative.
4. Define exception. State built-in exceptions.
5. Explain life cycle of thread.
6. Write a program to create two threads. One thread will print even no. between 1 to 50 and
other will print odd number between 1 to 50.
7. Define thread priority. Write default priority values and the methods to set and change
them.
UNIT – III – INHERITANCE, INTERFACE AND PACKAGE (2 marks)

1. List the types of inheritance which is supported by java.


2. List any four java API packages.
3. Define interface and package.

UNIT – IV – EXCEPTION HANDLING AND MULTITHREADING (2 Marks)

1. Define thread. Mention 2 ways to create thread.


2. Write a syntax of try-catch-finally blocks.
3. Define error. List types of error.

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.

You might also like