java
java
3rd Semester
Reg/Back Examination: 2023-24
Object Oriented Programming Using JAVA
AERO, AE, AG,AEIE,AUTO,BIOMED,BIOTECH, CHEM, C&EE, CIVIL, CST, CSEAI, CSEDS, CSE,
CSIT, CSEAIME, ELECTRICAL & C.E, EEE, ELECTRONICS & C.E, EIE, ELECTRICAL, ECE,
ENV, ETC, IT, MANUTECH, MECH, MME, MMEAM, METTA, MINERAL, MINING, PT,
PLASTIC
Time: 3 Hour
Max Marks: 100
Q. Code: N414
Answer Question No.1 (Part-1) which is compulsory, any eight from Part-II and any two
from Part-Ill.
The figures in the right-hand margin indicate marks.
Part-I
Q1 z Answer the following questions: (2 x 10)
a) Define OOP.
<b) Can we overload a static method in JAVA? Explain.
7c). Explain different operators in JAVA.
cd) What is constructor overloading?
What is inheritance?
__A) Can we overload or override the main method in JAVA? Explain.
r_.-g) How do we set priorities for threads?
-h) What is scope of variable?
i) What is constructor? Explain with JAVA program.
What are wrapper classes?
Part-II
Q2 Only Focused-Short Answer Type Questions- (Answer Any Eight out of (6 x 8)
Twelve)
A) Discuss public, private, protected and default access modifier with example.
Describe how JAVA supports runtime polymorphism with an example by
considering get Interest Rate() of RBI being overridden with get Interest Rate() of
various banks like sbi, axis, icici, etc which extend RBI.
c) Justify statement.
JVM is platform dependent.
(ii) There is no destructor in JAVA.
Part-III
Only Long Answer Type Questions (Answer Any Two out of Four)
Q3 a) Explain the life cycle of an applet with neat diagram and state the reason for (8)
destroy() method invocation.
b) What is multithreading? Explain how multithreading in single processor system is (8)
different from multithreading in multiprocessor system.
Q4 4f Write a JAVA program that simulates a traffic light. The program lets the user (8)
select one of three lights: red, yellow, or green with radio buttons. On selecting a
button, an appropriate message with "Stop" or "Ready" or "Go" should appear
above the buttons in selected color. Initially there is no message shown.
Write a program to create two threads, one thread Will print odd numbers and (8)
second thread will print even numbers between 1 to 20 numbers.
Q5 a) Write a JAVA Program that inserts book details like bookid, author, pages, price, in (8)
to library database, update the database by adding publisher column and display the
result from library database using JDBC connectivity.
b) Explain the necessity of drivers and describe the steps involved in establishment of (8)
a JDBC connection to retrieve the data from database.
Q6 a) Write a JAVA program that reads a .txt file from user and display number of words (8)
and lines in the file.
b) What is an Exception? List out the keywords for exception handing and write steps (8)
to develop user defined exception.