Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
64 views

Cst205 Object Oriented Programming Using Java, December 2022

The document discusses object oriented programming using Java. It contains questions about Java concepts like classes, objects, inheritance, exceptions, interfaces, multithreading and more. It also contains programming problems to demonstrate various Java features.

Uploaded by

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

Cst205 Object Oriented Programming Using Java, December 2022

The document discusses object oriented programming using Java. It contains questions about Java concepts like classes, objects, inheritance, exceptions, interfaces, multithreading and more. It also contains programming problems to demonstrate various Java features.

Uploaded by

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

D

CoLt
0800csT205L22roL

Reg No.: Name:


APJ ABDUL KALAryI TECHNOLOGICAL UN
Third Semester B.Tech Degree Regular and Supplementary Examination

Course Code: CST205


Course Name: OBJECT ORIENTED PROGRAMMING USING JAVA
Max. Marks: 100 Duration:3 Hours
PART A
Answer all questions. Each question coties 3 marks Marks
I How is platform independence achieved in Java? (3)
2 Explain how garbage collection is done in Java. (3)
3 Explain the use of static variable with the help of an example. (3)
4 Can final modifier be used with an abstract class. Justi$i your answer. (3)
5 Differentiate between the usage of keywords throw and throws. (3)
6 Explain the significance of cLASSPATH environment variable in Java. (3)
7 List any three event sources and their corresponding event types and listeners (3)
used.

8 Illustrate the creation of arraylist with the help of a sample program. (3)
9 Compare Swing API and AWT API. (3)
l0 What are layout managers? List any twolayout managers. (3)
PART B
Answer any onefull questionfrom each module. Each question carries 14 morks
Module I
ll a considlr the problem o,f a Service Station which provides three types of (10)
services to its customers: refuelling, vehicle maintenance and parking.
L

Customer can pay using cash, card or cftreque. The pricing for vehicle
maintenance depends on the cost of parts and labour. Parking areas are rented
according to weekly and monthly rates. Construct an UML class diagram for
the above problem by identiffingatleast six entities in the system which can
be represented using classes and show the relationship between them.

b Describe programming structure of Java that deals with the organization of (4)
Java code.

12a Differentiate between the two main approaches of software design. (7)

Page lof3
-,--,

0800csT205L22L0t

b Construct a UML Activity diagram for an online Hotel Reservation System, (7)
which shows the flow of activities for booking rooms at a hotel.
Module 2
13 a Write aJava program by creating a'student' class having the following data (7)

members: rollNumber, name, mathMarks, phyMarks, chemMarks and


methods getRequiredDetails0 - to get required input and displayAverage0 -
to calculate average marks and display it. In class 'Implement' create an

object ofthe Student class and get the required details from user and display
the average marks ofthat student.
b Write a javaprogram that illustrates how'this' keyword can be used to resolve (7)

the ambiguity between formalparameters and instance variables.


14 a Explain the concept of method overloading with the help of a program . (7)

b What is inheritance? Illustrate hierarchical inheritance using a sample (7)


program.
Module 3
15 a Write a program to read the first n characters in a file where n is given by the (7)

user. The characters read from file has to be reversed and displayed on

screen. Built in methods can be used in the program.


b Explain the role of access modifiers when packages are used in Java. (7)

16 a Create a user defined exception 'InvalidAgeException'. Write aJava program (7)


that takes age as a Command Line Argument. Raise the Exception
'InvalidAgeException' if age is less than 18.

b Explain the concept of Serialization and demonstrate how an object can be (7)
ierialized *ittt u sample program.

Module 4
17 a Illustrate the event handling mechanifr'r in Java using the Delegation Eveni (S)

Model with the help of a diagram.


b Illustrate the usage of the following methods related to String with appropriate (6)
sample code.

find0 (ii)substring0 (iii) replace0


(i)
18 a What is multithreading? Write a multithreaded Java program that (7)

demonstrates the working of wait0 and notifuQ methods.

Page 2of3
6ffif;1'95122l:fr

b Exdsin how ActionEvent class and FocusEvent class is used widr emfusis (7)
on tb nrcthods and cffimfl} provided by ttre given classes
-:'
Module 5
lg a fir$t€xt$eld
Write aJavaprogGffin that usestrwffitfields and abutton. The (9)
acc@s ternperature ia Celsius. When the 'Convert' button is clbld the
s@md textfield di$ays the tem@rture in Fahrenheit. Use aplopriate
. Swing compurents erd event handliqg techniques. F{C*9 /5)+32
b Deseribe the two difPerent ways to creat€ fames using Swing package with (5)
appropriate exurrylcs.
29 a Dims the Modcl View Controlter (lVfVC) Architecture using a dkryam. (n
Also'list'wt $c dr*gm'cf unitingprqrdns based on MVC Architedur€.
li b Explain the various @s fur connw*ing tq'databes€ using JDBC API, u*rg a (a
sample program.

-: 'JF?

Pqe hf 3

You might also like