Unit Test 2 Java Question Bank

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

UNIT TEST -2 JAVA QUESTION BANK

1) Give any two methods from File class with their usage.
2) Define exception. State any four built in Exceptions in Java.
3) Write a syntax and example of (i) drawRect( ) (ii) drawoval( )
4) Enlist any 4 keywords used for exception handling in Java.
5) Write syntax and usage of following methods: i) paint() ii) getParameter()
6) Describe attributes of <applet> tag.
7) Write any two methods from Character Stream classes.
8) Describe methods of creating a thread with example.
9) Describe Applet life cycle with diagram.
10) Explain the following classes. (i) Byte Stream Class (ii) Character Stream Class
11) Write a program to design an Applet showing three concentric circles filled with three
different colors.
12) Describe life cycle of thread with suitable diagram.
13) Write a program to define two threads for displaying even and odd numbers respectively
with a delay of 500 ms after each number.
14) Describe types of Errors and Exceptions in details.
15) Explain how to pass parameter to an applet? Write an applet to accept username in the
form of parameter and print “Hello ”.
16) Give the syntax of < param > tag to pass parameters to an applet.
17) Define stream class. List its types.
18) Distinguish between Input stream class and output stream class.
19) Write a program to copy content of one file to another file.
20) 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).
21) Write a program to input name and age of a person and throw an user defined exception,
if the entered age is negative.
22) Differentiate between Java Applet and Java Application
23) Enlist types of stream classes and describe methods for reading and writing data for each
type.

You might also like