Java 2013
Java 2013
Fifth Semester
Information Technology
IT 2301/IT 51/10144 IT 501- JAVA PROGRAMMING
(Regulation 2008/2010)
Time: Three hours
Maximum : 100
Marks
Answer ALL questions
PART A-(10 x 2 =20 marks)
1) What is static in java
2) What is the difference between a constructor and a method?
3) What is a string buffer class and how does it differs from string class?
4) Why is multiple inheritance using classes a disadvantage in java?
5)
How to define an interface?
6) What is a stream and which class allows you to read objects directly from a stream?
7) What is the relationship between an event- listener interface and an event adapter class?
8) Why are swing components called lightweight component?
9) What is java virtual machine?
10) Why do we need run() and start() method both? Can we achieve it with only run method?
m
o
c
.
s
te
a
d
p
u
u
.a
Or
b) i) How will you display an image on the frame in a window using java. (8)
ii) What is meant by stream? What are the types of streams and classes? Explain in detail.
(8)
m
o
14) a) What is event handling in java? List out the available event classes and listener interfaces
with suitable example. (16)
Or
b) What is exception handling in java? Why it is used? Write a java code to simulate the way a
stack mechanism works with exception handling, throwing and dealing with exceptions such as
stack is full(if you want to add more elements into the stack) or stack is empty(you want to pop
elements from the stack).
c
.
s
te
15) a) Explain in detail about generic classes and methods in java with suitable example.(16)
Or
b) Write a java program for inventory problem to illustrates the usage of thread synchronized
keyword and inter thread communication process. They have three classes called consumer,
producer and stock.
.a
a
d
p
u
u