GIET UNIVERSITY, GUNUPUR.
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
SUBJECT: OOP USING JAVA
QUESTION BANK
Subject Code: BCSPC3030
OBJECTIVE QUESTION
PART-A
UNIT-01
1. ____________ is one of the java features that enables java program to run anywhere
anytime.
a)Object-Oriented
b) Multithreaded
c)Platform-Independent
d) Dynamic & Extensible CO1/PO1
2. _____________ is one of the java features that can handle multiple tasks simultaneously.
a)Object-Oriented
b) Dynamic & Extensible
c)Platform-Independent
d) Multithreaded CO1/PO1
3. Java compiler translates source code into _____________
a) Bytecode (Virtual Machine Code)
b) Bitcode
c) Machine Code
d) User code CO1/PO1
4. Java interpreter translates _____________ into machine code.
a)Bit code
b) Bytecode(Virtual Machine Code)
c)Machine Code
d) User code CO1/PO1
5. Java compiler produces an intermediate code known as ____________
a)Bitcode
b) Machine Code
c)Bytecodes
d) User code CO1/PO1
6. ____________ tool helps us to find errors in our programs.
a)jhelp
b) javah
c)javap
d) jdb CO1/PO1
7. The process of converting one date type to another is called__________
a)Translating
b) Casting
c)Compiling
d) Declaring CO1/PO1
8. Java does not support ______________.
a)Operator overloading
b) Global variable
c)Multiple inheritance
d) All of above CO1/PO1
9. Casting from byte to __________ data type, the result is no loss information.
a)short
b) int
c)long
d) all of above CO1/PO1
10. ___________ refer to fix value that does not change during the execution of a program.
a)variables
b) constants
c)identifiers
d)integer CO1/PO1
11. ____________ operators are used to construct mathematical expression as in algebra.
a)Relational
b) Mathematical
c)Arithmetic
d) Logical
12. The comparisons can be done with help of ____________ operator.
a)Relational
b) Mathematical
c)Arithmetic
d) Assignment CO1/PO1
13. Which of the following is not assignment operator?
a)+=
b) = =
c)%=
d) = CO1/PO1
14. _____________ operator is used to construct conditional expression.
a)Dot(.)
b) instanceof
c)Ternary(?:)
d) None CO1/PO1
15. Which statement is use to skip the loop and continue with the next iteration?
a)continue
b) terminate
c)skip
d) break CO1/PO1
16. _________ is a group of contiguous or related data items that share a common name.
a)Variable
b) Array
c)Constant
d) none CO1/PO2
17. Identify the following and find the correct declaration statement in java program?
a) int num=new int[5]
b) int num=new num[5]
c) int[] num=new int[5]
d) None
18. class ope CO1/PO2
{
public static void main (String [] args)
{
int x= 0;
int y= 0;
if (( ++x >= 1 ) & (++y <=1))
{
x++;
}
System.out.println(x + " " + y);
}
}
i. 2 1 ii. 1 2 iii. Compilation time error IV. No output
19. class ope CO1/PO2
{
public static void main(String [] args)
{
int x = 11 & 9;
int y = x ^ 3;
System.out.println( y | 12 );
}
}
i. 14 ii. 11 iii. 9 IV. 3
20. public class VST CO1/PO2
{
public static void main(String args[])
{
int x = -4;
System.out.println(x>>1);
int y = 4;
System.out.println(y>>1);
}
}
I. -2 2 II. 2 2 III. 0 2 IV. None of the these
21. public class VST CO1/PO2
{
public static void main(String args[])
{
System.out.print(10 + 20 + "GIET");
System.out.println("GIET" + 10 + 20);
}
I. 30GIET GIET 30 II. 1020GIET GIET1020 III. 30GIET IV. None of the
above
22. public class VST CO1/PO2
{
public static void main(String args[])
{
int x=9;
int y=0;
if((++x) ==10 && (++y)==1)
{
System.out.println(x);
System.out.println(y);
}
}
}
23. public class Test CO1/PO2
{
public static void main(String[] args)
{
for (int i = 0; i < 10; i++)
int x = 10;
}
}
i. No Output ii. 2. 10 iii. Compile time error iv. 4. 10 (10 times)
24. public class Test CO1/PO2
public static void main(String[] args)
{
for (int i = 0, String = "GFG"; i < 2; i++)
System.out.println("HELLO GEEKS");
}
}
I. HELLO GEEKS
II. Compile time error
III. HELLO GEEKS
HELLO GEEKS
HELLO GEEKS
IV. No Output
25. class WeekDays CO1/PO2
{
public static void main(String s[])
{
int day = 7;
switch(day)
{
case 1:
System.out.println("Monday");
case 2:
System.out.println("Tuesday");
case 3:
System.out.println("Wednesday");
case 4:
System.out.println("Thursday");
case 5:
System.out.println("Friday");
}
}
}
I. no output ii. Compilation time error iii. Sunday iv. Runtime error
UNIT-02
1. The java interpreter uses ____________ method before any objects are created.
a)Class
b) Main
c)Constructor
d) All of above CO2/PO1
2. The ____________ includes hundred of classes and methods grouped into several
function packages.
a)API
b) JVM
c)JAVAC
d) JRE CO2/PO1
3. Java provides extensive set of classes, arranged in ___________.
a) Package
b) Library file
c) Template class
d) None CO2/PO1
4. A default constructor takes ________no of parameter ? CO2/PO1
i. 0 ii. 1 iii. No argument iv. Non of them
5. Super keyword in java is used to CO2/PO1
a. Refer immediate parent class instance variables.
b. Invoke immediate parent class methods.
c. Invoke immediate parent class constructor.
d. All
6. Using which keyword we can access value of the instance variables and class
variables of that class inside the method of that class itself. CO2/PO1
A) super
B) final
C) this
D) either super or this
7. Find the out put of the program CO2/PO2
public class t
{
public static void main(String [] args)
{
String s=null;
System.out.println(s.concat("abc"));
System.out.println(s);
}
}
a. nullabc b.abc c.no output d.NullPointerException
8. ______________is a feature in C++ where two or more functions can have the same
name but different parameters.
a. Function overloading b. function overriding c.non of them CO2/PO1
9. When no access modifier is specified for a class , method or data member – It is said
to be having the default access modifier by default.
a. Private b. public c. protected d. default CO2/PO1
10. The Java programming language supports multiple inheritance of type, which is the
ability of a class to implement more than one_______.
a. Interface b.class c. non of them d. super class
11. Find the output of the program.
public class str CO2/PO2
{
public static void main(String [] args)
{
String foo="base";
System.out.println(foo.substring(0,3));
System.out.println(foo.concat("sub"));
System.out.println(foo);
}
}
a. bas
basesub
base
b. base
basesub
bas
c. no output
12. find the output of the program CO2/PO2
try
{
int x = 0;
int y = 5 / x;
}
catch (Exception e)
{
System.out.println("Exception");
}
catch (ArithmeticException ae)
{
System.out.println(" Arithmetic Exception");
}
System.out.println("finished");
a. Finished b. exception c. compilation fails d. exception arithmetic
exception finished
13. Find the output of the program
public class Foo
{
public static void main(String[] args) CO2/PO2
{
try
{
return;
}
finally
{
System.out.println( "Finally" );
}
}
}
a. Finally b. compilation fails c. no output d. an exception thrown at run
time
14. Final and finally are both same in java? CO2/PO1
a. Yes b. no
15. Java supports multiple inheritance? CO2/PO1
a. True b.false
16. Checked exception are compilation time error in java programming. CO2/PO1
a. True b.false
17. class Test CO2/PO1
{
int i;
}
class Main
{
public static void main(String args[])
{
Test t;
System.out.println(t.i);
}
I. 0 II. Garbage valueIII. Compilation time Error IV. No output
18. In Java, when we implement an interface method, it must be declared as:CO1/PO1
i. private ii. Protected iii. Public iv. default
19. class Helper CO2/PO1
{
private int data;
private Helper()
{
data = 5;
}
}
public class Test
{
public static void main(String[] args)
{
Helper help = new Helper();
System.out.println(help.data);
}
}
i. compilation error ii. 5 iii. Run time error iv.
None of these
20. Identify the output of the following program after execution? CO2/PO2
class array_output {
public static void main(String args[])
{
int array_variable [] = new int[10];
for (int i = 0; i < 10; ++i) {
array_variable[i] = i;
System.out.print(array_variable[i] + " ");
i++;
}
}
}
I. 02468 II. 1 3 5 7 9
III. 0 1 2 3 4 5 6 7 8 9 IV. 1 2 3 4 5 6 7 8 9 10
21. class output CO2/PO2
{
int x,y;
output()
{
x=y=0;
}
void put()
{
System.out.println(x+” “+y+” “+x/y);
}
Public static void main(String args[])
{
output ob=new output();
o.put();
}
}
I. 0 0 0 II. 1 1 1 III. no output IV. zero divide error
22. Static variable are the property of instance CO2/PO1
i. True ii. . false
23. A java program can run without main() CO2/PO1
i. True ii. false
24. Super and this usage are same in java CO2/PO1
I. True ii. False
25. Constructor execution in top to bottom approach in inheritance CO2/PO1
I. True ii. False
UNIT-03
1. Thread are called as________________? CO3/PO1
a. Light weight process b. heavy weight process c. process d. demon thread
2. sleep() and stop() are same in concept in threading? CO3/PO1
What is true about threads?
a.Threads consumes CPU in best possible manner
b.Threads enables multi processing.
c.Multi threading reduces idle time of CPU
d.All
3. How many threads can a process contain? CO3/PO1
a.1
b.2
c.multiple
d.none
4. What are valid points about thread CO3/PO1
a.Thread are subdivision of Process.
b.One or more Threads runs in the context of process.
c.Threads can execute any part of process. And same part of process can be executed by multiple
Threads.
d.All
5. What are valid point about processes CO3/PO1
a.Processes have their own copy of the data segment of the parent process
b.Threads have direct access to the data segment of its process
c.Processes have their own address
d.All of these
6. How can we create Thread CO3/PO1
a.By Extending Thread class
b.Implementing Runnable interface
c.By using Executor framework - which can internally form threads CO3/PO1
d.All
7. Which of these is not a Thread state? CO3/PO1
a.New
b.Runnable
c.sleep
d.terminated
8. synchronized instance methods acquire lock on? CO3/PO1
a.object
b.class
c.All
d.None
9. What state does Thread enter in when it has been created and started? CO3/PO1
a.New
b.Runnable
c.Running
d.Waiting
10. Which method can be used to find whether Thread hasn't entered dead state? CO3/PO1
a.isAlive()
b.isRunning()
c.isNotDead
d.All
11. How can you ensure all threads that started from main must end in order in which they started
and also main should end in last CO3/PO1
a.join() method
b.sleep() method
c.wait() method
d.run() method
12. What is difference between starting thread with run() and start() method? CO3/PO1
a.There is no difference
b.When you call start() method, main thread internally calls run() method to start newly created
Thread
c.run() calls start() method internally
d.None
13. What are valid statements for suspend() and resume() method? CO3/PO1
a.Suspend() method is deadlock prone.
b.If the target thread holds a lock on object when it is suspended, no thread can lock this object until
the target thread is resumed.
c.If the thread that would resume the target thread attempts to lock this monitor prior to calling
resume, it results in deadlock formation.
d.All
14. How can Thread go from waiting to runnable state? CO3/PO1
a.notify/notifAll
b.When sleep time is up
c.Using resume() method when thread was suspended
d.All
15. Thread is a ________ process. CO3/PO1
a. Light weight b.heavy weight c. medium weight d. non of them
16. A Thread class can be extended. CO3/PO1
a. True b. false
17. Which of these class is not a member class of java.io package? CO3/PO1
A. String B. StringReader C. Writer D. File
18. Which of these interface is not a member of java.io package? CO3/PO1
A. DataInput B. ObjectInput C. ObjectFilter D. FileFilter
19. Which of these classes is used for input and output operation when working with bytes?
A. InputStream B. Reader C. Writer D. All of the mentioned CO3/PO1
20. Which of these class is used to read and write bytes in a file? CO3/PO1
A. FileReader B. FileWriter C. FileInputStream D. InputStreamReader
21. Which of these class can be used to implement input stream that uses a character array as the
source? CO3/PO1
A. BufferedReader B. FileReader C. CharArrayReader D. FileArrayReader
22. Which of these classes are used by Byte streams for input and output operation?CO3/PO1
A. InputStream B. InputOutputStream C. Reader D. All of the mentioned
23. Which of these classes are used by character streams for input and output operations? CO3/PO1
A. InputStream B. Writer C. ReadStream D. InputOutputStream
24. Which exception is thrown by read() method? CO3/PO1
A. IOException B. InterruptedException C. SystemException D. SystemInputException
25. Which of these class is used to read characters and strings in Java from console? CO3/PO1
A. BufferedReader B. StringReader C. BufferedStreamReader D. InputStreamReader
UNIT-04
1. Which of these functions is called to display the output of an applet? CO4/PO1
a) display()
b) paint()
c) displayApplet()
d) PrintApplet()
2. The following example shows the creation of a CO4/PO2
import java.applet.*;
import java.awt.*;
public class Main extends Applet{
public void paint(Graphics g){
g.drawString("Welcome in Java Applet.",40,20);
}
}
a. Banner using Applet
b. Basic Applet
c. Display clock
d. None of the above
3. From the following statements which is a drawback for Applet? CO4/PO1
a. It works at client side so less response time
b. Secured
c. It can be executed by browsers running under many platforms, including Linux, Windows, and Mac
Os etc.
d. Plugin is required at client browser to execute applet
4. Applet works at client side so less response time. CO4/PO1
a. True
b. False
5. What invokes immediately after the start() method and also any time the applet needs to repaint
itself in the browser? CO4/PO1
a. stop()
b. init()
c. paint()
d. destroy()
6. Which method is called only once during the run time of your applet? CO4/PO1
a. stop()
b. paint()
c. init()
d. destroy()
7. Which of these methods are used to register a keyboard event listener? CO4/PO1
a) KeyListener()
b) addKistener()
c) addKeyListener()
d) eventKeyboardListener()
8. Which of these methods are used to register a mouse motion listener? CO4/PO1
a) addMouse()
b) addMouseListener()
c) addMouseMotionListner()
d) eventMouseMotionListener()
9. Event class is defined in which of these libraries? CO4/PO1
a) java.io
b) java.lang
c) java.net
d) java.util
10. Which of these methods can be used to determine the type of event? CO4/PO1
a) getID()
b) getSource()
c) getEvent()
d) getEventObject()
11. Which of these class is super class of all the events? CO4/PO1
a) EventObject
b) EventClass
c) ActionEvent
d) ItemEvent
12. Which of these methods can be used to output a sting in an applet?
CO4/PO1
a) display()
b) print()
c) drawString()
d) transient()
13. Which of these operators can be used to get run time information about an
object? CO4/PO1
a) getInfo
b) Info
c) instanceof
d) getinfoof
14. What is the Message is displayed in the applet made by this program?
CO4 /PO2
import java.awt.*;
import java.applet.*;
public class myapplet extends Applet
{
public void paint(Graphics g)
{
g.drawString("A Simple Applet", 20, 20);
}
}
a) A Simple Applet
b) A Simple Applet 20 20
c) Compilation Error
d) Runtime Error
15. which of these functions is called to display the output of an applet?
CO4/PO1
A. display()
B. print()
C. displayApplet()
D. PrintApplet()
PART-B
UNIT-01
1. Define byte code in java? CO1/PO1
2. Why java called platform independent language? CO1/PO1
3. Why java called write once, run anywhere language? CO1/PO1
4. Why the function main() always declared as static in java? CO1/PO1
5. Write the coding part to find the reverse of a number by accepting number Command
Argument. CO1/PO3
6. Write the codes to check the biggest among three numbers using ternary operator? CO1/PO3
7. Exemplify Class and object in Java. CO1/PO1
8. Describe the uses of parseInt() in Java programming. CO1/PO1
9. Differentiate static and dynamic array in java with an small example? CO1/PO1
10. Identify type casting in java Programming? CO1/PO1
UNIT-02
1. Describe the syntax of any one of the following loops –
while, do...while, for loop CO2/PO1
2. State method overriding. CO2/PO1
3. Differentiate between a static and non static data member in java? CO2/PO1
4. Diffentiate between a static and dynamic array in Java ? CO2/PO1
5. Estimate various restrictions with static methods? CO2/PO1
6. Write a code to access the super class methods and instance variables by using super keyword
from sub class CO2/PO2
7. Write a method with variable arguments that accepts a group of numbers and returns the biggest
number among them.
8. Identify the final variable with a suitable java code. CO2/PO1
9. Discuss the meaning of the abstract keyword? CO2/PO1
10. Differentiate between catch() and finally in Java. CO2/PO1
UNIT-03
1. Predict the exception does the program throw? CO3/PO1
Public class test
{
Public static void main(String args[])
{
String s=”abc”;
System.out.println(“char at”,s.charAt[3]);
}
}
2. Choose the name of the method is used to start a thread execution? CO3/PO1
3. Differentiate between string and string buffer class? CO3/PO1
4. Define the behavior of == operator in string class with code ? CO3/PO1
5. Differentiate between implements and extends? CO3/PO1
6. What is the difference between checked and unchecked exception in java? CO3/PO1
7. Enlist the importance of finally keyword in exception handing?CO3/PO1
8. Identify 2 checked exception names CO3/PO1
9. Differentiate between isAlive() and Join() in MultiThreading? CO3/PO1
10. Judge the output CO3/PO1
public class Foo
{
public static void main(String[] args)
{
try
{
return;
}
finally
{
System.out.println( "Finally" );
}
}
}
UNIT-04
1. Explain about event delegation? CO4/PO2
2. Differentiate between Applet and AppletViwer? CO4/CO1
3. Define “public void init()” in Applet? CO4/PO1
4. Identify the attributes of applet tag? CO4/PO1
5. Define Adapter Class CO4/CO1
6. Select the methods of Mouse Listener. CO4/PO3
7. Define (1) Event (2) Event Source (3) Event Class (4) Event Listener CO4/PO2
8. Describe the methods (1) setBackground( ) (2) setForeground( ) CO4/PO3
9. Compare the difference between java applet program and java application program.
CO4/PO1
10. Differentiate between applet and applet viewer? CO4/PO1
LOGN QUESTION : [ EACH CARRIES 7 / 8 / 10 MARKS]
UNIT-01
1 A. Define object-orientation and specify the characteristics of CO1/PO1(7mark)
object oriented approach?
b. Evaluate a program for computing x y doing repetitive CO3/PO3(8 marks)
multiplication. X and y are of type integer and are to be given as
command line arguments. Raise and handle exception(s) for
invalid values of x and y.
2 A. Write a java program to print maximum between 3 positive CO1/PO2(7 marks)
number using conditional operator?
B. Write a java program to print “Java is Good” 10 times using for CO1/PO2(8 marks)
loop, while loop and do-while loop?
3 A. Write a program to check the give number is prime or not? CO1/PO1(8 makrs)
B. Demonstrate a java program to implement Selection sort? CO1/PO2 (7
marks)
4 A. Write a Java program that prints the following pattern CO1/PO3(8marks)
12345
1234
123
12
1
B.Demonstrate Loop in java and write a program to print CO1/PO2(7mark)
1 to 10 using for loop, while loop and do..while loop?
5 A. Demonstrate a Java program to search an element CO1/PO1(7mark)
using binary search.
B. Design a Java program to perform addition of two CO1/PO1(8mark)
matrices, where the values are accepted to the both matrix
at run time using Buffer Reader Class.
6 A. Demonstrate a Java program to accept a number at run CO1/PO1(7mark)
time using scanner class and check the given number is
Armstrong or not?
B. Demonstrate a Java program to convert a binary CO1/PO1(8mark
number to decimal number
7 A. Define for each loop in java with a suitable example? CO1/PO1(7mark)
B. Define static data member in java and demonstrate a CO1/PO2 (8mark)
suitable example to count the number of objects
constructed using static data member?
8 A. Differentiate between Scanner class and Buffered Reader CO1/PO1(7mark)
class in java with a suitable
example?
B. Describe JVM and explain and draw the Architecture of CO1/PO2(8 mark)
JVM?
UNIT-02
1 A. Design a java program to create to display your name, CO2/PO1(7 marks)
branch with your college name?
B. Define function over loading and write a program to CO2/PO2(8 marks)
calculate the area of Circle, Sphere and Square using function
overloading concept?
2 A. Differentiate between function over loading and constructor CO2/PO1 (8mark)
overloading with a suitable example?
B. Discuss about constructor? Explain constructor overloading CO2/PO1(7marks)
with example
3 Define short notes any 3 of the following CO2/PO1(15mark)
Static b.final c.garbage collection d.constructor
4 A. Differentiate between class and interface with suitable CO2/PO1(7 mark)
example?
B. Write a Java program to implement CO2/PO1 (8 mark)
Polymorphism.(Note: Consider a scenario, Bank is a class
that provides method to get the rate of interest. But, rate of
interest may differ according to banks. For example, SBI,
ICICI and AXIS banks are providing 8.4%, 7.3% and
9.7% rate of interest
5 1. Write a program to demonstrate the multipath inheritance for CO2/PO3(15 marks)
the classes having relations as shown in figure 1
.
6 A. State the difference between Method overloading and CO2/PO1 (8 mark)
method overriding with example.
B. Differentiate between interface and abstract class with CO2/PO1 (7 mark)
suitable example?
7 A. Differentiate between auto boxing and unboxing? CO2/PO1(7mark)
B. Explain about collection in Java? Differentiate between CO2/PO1 (8 mark)
Vector and Array List
8 A. List out any five methods of String Buffer class by suitable CO2/PO1(8 marks)
example.
B. List the 5 methods of String Buffer class with a suitable CO2/PO1(7 marks)
Example
9 A. Wap to accept a string and check whether it is a CO2/PO1 (7 marks)
peliondramic or not ?
B. Classify the uses of super keyword and explain why it is CO2/PO1(8 marks)
used? Write a java program to find out cost, weight and
volume of a box using multilevel inheritance and use super
keyword at proper places?
10 A. Tell about package? Design a program to find out sum of CO2/PO2(8marks)
product of consecutive digits of a number using interface,
package and command line arguments?
Suppose Number is 12345 then Result will be1+2+3+4+5
B.Explain the following terms with respect to exception CO2/PO1(7 marks)
handling.
i) try ii) catch iii) throw iv) finally
11 Explain following with example: CO2/PO1(15 marks)
i) Finalize()
ii) static
iii) super
iv) final
12 A.Describe Inheritance and its type with suitable diagrams CO2/PO1(8 marks)
CO2/PO1(8 marks
B. Differentiate String class and StringBuffer class? CO2/PO1(7 marks)
13 Define short notes on any thred of the following CO2/PO1(15mark)
14 Recall package? Define the benefits of package? Explain Java CO2/PO1(15 marks)
API packages with a suitable example
15 1. Explain the following method uses in Sring Buffer class with CO2/PO1(15mark
examples?
append() b.insert() c.replace() d. delete() e.length
UNIT-03
1 a. Compose a program to create two threads, one thread will CO3/PO3(8 marks)
print odd numbers and second thread will print even numbers
between 1 to 20 numbers.
b. Describe the difference between checked and unchecked CO3/PO1(7 marks)
exception? List at least 5 un-checked exception class names.
2 a.Explain about thread? Describe the complete life cycle of CO3/PO1 (10 marks)
thread with example.
b. Design a JAVA Program to create a Thread and print the first 10 C03/PO3(5marks)
natural numbers along the Thread name by delay.
3 a. Illustrate a program to input two numbers using scanner class CO3/PO1(7 marks)
and find the division of the entered number. Use an appropriate
exception handling mechanism to handle arithmetic exception?
b.Evaluate a program for computing xy doing repetitive CO3/PO3(8 marks)
multiplication. X and y are of type integer and are to be given as
command line arguments. Raise and handle exception(s) for
invalid values of x and y?
4 a.What is user defined Exception in Java ? WAP to accept CO3/PO1(8mark)
student age and check whether he is eligible for vote or not?
Show an appropriate message when the age is not eligible?
b. Write a java program to store “Java file is good” in to a file CO3/PO3 (7 marks)
called “myfile.txt”.
5 A. .What is exception? And explain try, throw and catch with a CO3/PO1(8 marks)
suitable exemple?
b.Write a short note on Character Stream classes? CO3/PO1(7 marks)
6 Write short notes on the following CO3/PO1(15mark)
Join b. sleep c. start d. sleep e.yeild
7 a.Write a java program to shows how to read and write Files CO3/PO1(10
Using a RandomAccessFile Object marks)
b. Differentiate the following: CO3/PO3 (5 marks)
1. Text I/O v/s Binary I/O
8 Demonstrate a program to accept the first 10 natural numbers and CO3/PO2(15 marks)
store the even and odd numbers separately in to a text file called
“odd.txt” and “even.txt” ?
UNIT-04
1 a.What is an Applet? Explain the life cycle of Applet by a neat CO4/PO3(8marks)
diagram?
b.Explain life cycle of Applet. Create a simple Applet having a CO4/PO3 (7 marks)
message Hello?
2 A.Write a Java program to display digital clock by using CO4/PO3 (8mark)
Applet.
b.Write a Java program of event handling by implementing CO4/PO3 (7mark)
Action Listener?
3 A.Write a Java program to implement Mouse Motion CO4/PO3 (8mark)
Adapter?
b. Design an applet having a circle which is moving from left to CO4/PO3(7 marks)
right and reflected back from right to left continuously?
4 A.Design an applet that having three scroll bars for three colors CO4/PO3(15 marks)
red, green and blue with minimum 0 and maximum 255 values.
The background color of applet changes depending on the value of
the scroll bar at that time.