0% found this document useful (0 votes)
10 views

Java Programming March 2022

Uploaded by

sandhyabandaru89
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Java Programming March 2022

Uploaded by

sandhyabandaru89
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Code No: 154BE R18

JN
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
B. Tech II Year II Semester Examinations, March - 2022
JAVA PROGRAMMING
TU
(Common to CSE, IT)
Time: 3 Hours Max. Marks: 75
Answer any five questions
All questions carry equal marks
---
H
1.a) Design a java program to find the factorial of a given number.
b) Justify method overriding with a suitable example program. [7+8]
U
2.a) With suitable code segments illustrate various uses of „final‟ keyword.
se
b) Develop a java program to display the following output.
1
12
dP
123
1234
12345 [7+8]
a
3.a) How to define a package? How to access, import a package? Illustrate with examples.
b) Justify the concept of variables in interfaces and extending interfaces with example
pe
code. [9+6]

4.a) Design an interface called Shape with methods draw() and getArea(). Further design
rs
two classes called Circle and Rectangle that implements Shape to compute area of
respective shapes. Use appropriate getter and setter methods. Write a java program for
the same.
M
b) Demonstrate the Random access file operations. [9+6]

5.a) What is thread? Justify the producer - consumer problem using inter - thread
ar
communication.
b) Write a program to illustrate the use of multiple catch blocks for a try block. [9+6]
ch
6.a) Analyze the need of thread synchronization. How is it achieved in Java programming?
Explain with a suitable program.
b) Develop a program that includes a try block and a catch clause which processes the
20
arithmetic exception generated by division-by-zero error. [9+6]

7.a) Show the differences between Array List and Vector in Collection framework.
2
b) Design a program to store the names of bank depositors and their current balances by
using hash table. [6+9]
2
8.a) Design a program using an applet which will print “key pressed” on the status window
when you press the key, “key released” on status window when you release the key and
when you type the character it should print “hello” at co-ordinates (50,50) on Applet.
b) Demonstrates the different types of Event Listeners supported by java. [9+6]

---ooOoo---

You might also like