0% found this document useful (0 votes)
31 views11 pages

CS_s3

Uploaded by

mr.appu008
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views11 pages

CS_s3

Uploaded by

mr.appu008
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

OBJECT ORIENTED PROGRAMMING USING JAVA

Module 1
Part A Questions
QDescribe the role of JIT compiler.

Q Why Java is said to be robust?

Q How is platform independence achieved in Java?

Q Explain how garbage collection is done in Java.


Part B Questions

Q Distinguish between function oriented and object oriented design paradigms


with an example.
b) Draw a UML activity diagram for an order processing system.

Q a )Explain any four object oriented features of Java with suitable examples.

B) Draw a UML class diagram which shows structure and attributes of an ATM
with entities Bank, ATM, Debit Card, Customer, Account, ATM Transaction.
Q Consider the problem of a Service Station which provides three types of
services to its customers: refuelling, vehicle maintenance and parking.
Customer can pay using cash, card or cheque. 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 identifyingatleast six entities in the system which can
be represented using classes and show the relationship between them.
Describe programming structure of Java that deals with the organization of
Java code.

Q Differentiate between the two main approaches of software design.


Module 2

Part A Questions
Q. Explain the use of static variable with the help of an example.

Q Can final modifier be used with an abstract class. Justify your answer..

Q List the properties ofa constructor.

Q Discuss the use of public, private and protected access specifiers.


Part B Questions

Q Explain method overloading with an example.

Qa Explain dynamic method dispatch with an example


b Discuss the uses of final keyword citing examples.
Q Write a Java program by creating a 'Student' class having the following data
members: rollNumber, name, mathMarks, phyMarks, chemMarks and
methods getRequiredDetails() — to get required input and displayAverage() —
to calculate average marks and display it. In class 'Implement' create an
object of the Student class and get the required details from user and display
the average marks of that student.
Write a java program that illustrates how 'this' keyword can be used to resolve
the ambiguity between formal parameters and instance variables.

Q Explain the concept of method overloading with the help ofa program.
What is inheritance? Illustrate hierarchical inheritance using a sample
program.
Module 3

Part A Questions

Q Differentiate between the usage of keywords throw and throws.

Q Explain the significance of CLASSPATH environment variable in Java.

Q Distinguish between checked and unchecked exceptions.

Q Explain any three character stream classes in Java

Part B Questions

Q i)Create a package reversepackage. Add a class Reverse in it with a method


reverse() to print the reverse ofa string without using built-in methods. Create
a class outside the package and use this method to reverse a string.
ii) Explain object stream serialization with sample code.

Q a How do you create user defined exceptions in Java? Write a Java program to
find the average of n numbers entered as command line arguments. Raise a
user defined exception if the average exceeds 100.
b Explain the use of interface in Java.
Q Write a program to read the first n characters in a file where n is given by the
user. The characters read from file has to be reversed and displayed on
screen. Built in methods can be used in the program.
Explain the role of access modifiers when packages are used in Java.

Q Create a user defined exception 'InvalidAgeException'. Write a Java program


that takes age as a Command Line Argument. Raise the Exception
'InvalidAgeException' if age is less than 18.
Explain the concept of Serialization and demonstrate how an object can be
serialized with a sample program.
Module 4

Part A Questions
Q List any three event sources and their corresponding event types and listeners used
.
Q Illustrate the creation of arraylist with the help ofa sample program.

Q Explain the different methods of creating threads in Java.

Q List any three event listeners and the corresponding source object.

Part B Questions

Q
a) Write a multithreaded Java program with two threads. One thread generates
even numbers from I to 100 and another thread generates odd numbers from I
to 100. Ensure that the threads do not interfere.
b) Discuss the methods for String comparison with examples.

Q
a) Explain how event handling is done in Java.
b) How do you access the elements in an AeayList? Illustrate with an example
Q
Illustrate the event handling mechanisil in Java using the Delegation Event
Model with the help ofa diagram.
Illustrate the usage of the following methods related to String with appropriate
sample code.
(i) find() (ii)substring() (iii) replace()

Q What is multithreading? Write a multithreaded Java program that


demonstrates the working of wait() and notify() methods.
Module 5

Part A Questions
Q Compare Swing API and AWT API.

Q What are layout managers? List any two layout managers.

Q Describe the features of Swing.

Q Explain about the containers in Swing.

Part B Questions

Q a Explain with sample code the steps in establishing JDBC connectivity.


b Describe the architecture of JDBC with a neat diagram.

Q Write a GUI program to perform arithmetic operations of two numbers.


Discuss any three layout managers in Swing.
Q
a)Write a Java program that uses two textfields and a button. The first textfield
accepts temperature in Celsius. When the 'Convert' button is clicked the
second textfield displays the temperature in Fahrenheit. Use appropriate
Swing components and event handling techniques. F=(C*9/5)+32
b)Describe the two different ways to create frames using Swing package with
appropriate examples.

Q
a) Discuss the Model View Controller (MVC) Architecture using a diagram.
Also list out the advantages of writing programs based on MVC Architecture
b) Explain the various steps for connecting to database using JDBC API, using a
sample program.

You might also like