Java OOP Important Questions Guide
Java OOP Important Questions Guide
net
www.AUNewsBlog.net
www.AUNewsBlog.net
PART – B
1 Explain the types of package with its importance BTL1 Remembering
i. What is method? How method is defined? give example(6) BTL1 Remembering
2 ii. State the purpose of finalize() method in java? With an example
explain how finalize() method can be used in java program(7)
i. What is class? how do you define a class in java(6) BTL1 Remembering
3 ii. Define Package? How does compiler locate packages? Explain
arrays in java?(7)
i. Explain the features of Java and list out the characteristics of BTL1 Remembering
4 JAVA(7)
ii. Explain the characteristics of OOPs(6)
Summarize the types of constructors supported by JAVA with BTL2 Understanding
5 example.
i. Discuss the usage of constructor with an example using java(7) BTL2 Understanding
6 ii. Explain the object constructors and calling other constructor with
example(6)
With relevant examples describe abstraction and encapsulation. Write BTL2 Understanding
7 a java program that uses an abstraction and encapsulation.
Illustrate what is polymorphism? Write a java program that implements BTL3 Applying
8 Polymorphism.
Illustrate with an example the following features of constructors: BTL3 Applying
i. Default constructors (2)
ii. Parameterized constructor (2)
9 iii. Overloaded constructors (2)
iv. A call to another constructor with this operator( 2)
v. An object initialization block(2)
vi. A static initialization block(3)
i. Illustrate OOPS and explain the features of OOPS (7) BTL3 Applying
10 ii. Demonstrate the static fields and methods used in java (6)
BTL4 Analyzing
i. Distinguish argument and parameter? Discuss with example(7)
11
ii. Differentiate constructor and method with example(6)
12 Difference between OOPS and procedural programming language BTL4 Analyzing
13 Assess the different methods in java. Util. Arrays class with example BTL5 Evaluating
Create a Java program for push and pop operations in stack using BTL6 Creating
14 arrays in classes and object
PART – C
Write a program to perform the following functions using classes, BTL5 Evaluating
objects, constructors and destructors where essential
1 i. Get as input the marks of 5 students in 5 subjects (5)
ii. Calculate the total and average (5)
iii. Print the formatted result on the screen (5)
www.AUNewsBlog.net
www.AUNewsBlog.net
Make a class Student. The Student class has data members such as roll BTL6 Creating
number, name, branch. Create a class called Exam that has data
2 members roll number and six subject marks. Derive the result class
from Student and Exam it has own data members such as total mark,
and result. Write a Java program to model the relationships.
Create a java program to find a smallest number in the given array by BTL6 Creating
3 creating one dimensional array and two dimensional array using new
operator.
i. Write a Java program to Evaluate the following series 1-2+3- BTL5 Evaluating
4+…+n .(8)
4 ii. Write a Java program to test the prime numbers between the given
two limits(7)
UNIT II INHERITANCE AND INTERFACES
Inheritance – Super classes- sub classes –Protected members – constructors in sub classes- the Object
class – abstract classes and methods- final methods and classes – Interfaces – defining an interface,
implementing interface, differences between classes and interfaces and extending interfaces - Object
cloning -inner classes, ArrayLists - Strings
PART – A
BT
Q.No. Question Competence
Level
1 Define inheritance hierarchy. Give an example BTL1 Remembering
2 How will you define an interface in java program BTL1 Remembering
3 What is meant by abstract classes BTL1 Remembering
4 What is object cloning BTL1 Remembering
5 Define static inner classes BTL1 Remembering
6 What is class hierarchy? Give example BTL1 Remembering
7 In java describe the use of Interfaces? BTL2 Understanding
8 Describe the purpose of the keyword “final” BTL2 Understanding
Summarize static binding (early binding) and dynamic binding (late
9 BTL2 Understanding
binding)
Describe wrapper classes? Why the wrapper classes are defined as
10 final BTL2 Understanding
www.AUNewsBlog.net
www.AUNewsBlog.net
19 Create a java program to remove all white spaces from a string in java BTL6 Creating
If ObjA1 is an object of a class A created using new keyword, what
20 BTL6 Creating
does the statement A ObjA2=ObjA1; mean?
PART – B
www.AUNewsBlog.net
www.AUNewsBlog.net
Create a static Inner class called Pair which has MinMax method for
1 BTL6 Creating
finding min and max values from the array
Develop an Employee class which implements the Comparable and
Cloneable interfaces. Implement the sorting of persons (based on
2 name in alphabetical). Also implement the shallow copy (for name BTL5 Evaluating
and age) and deep copy (for DateOfJoining)
Develop an Interest interface which contains simpleInterest and
3 compInterest methods and static finalfield of Rate 25%. Write a class BTL5 Evaluating
to implement those methods
Create a abstract Reservation class which has Reserve abstract
4 method. Implement the sub-classes like ReserveTrain and ReserveBus BTL6 Creating
classes and implement the same
UNIT III EXCEPTION HANDLING AND I/O
Exceptions - exception hierarchy - throwing and catching exceptions – built-in exceptions, creating own
exceptions, Stack Trace Elements. Input / Output Basics – Streams – Byte streams and Character
streams – Reading and Writing Console – Reading and Writing Files
PART – A
BT
Q.No. Question Competence
Level
1 List the different ways to handle exceptions BTL1 Remembering
Examine the purpose of the finally clause of a try-catch-finally
2 BTL1 Remembering
statement
3 Tell the use of assert keyword BTL1 Remembering
4 Define a file? Why do we require files to store data BTL1 Remembering
What is the basic difference between the 2 approaches to exception
5 BTL1 Remembering
handling
What if there is a break or return statement in try block followed by
6 finally block BTL1 Remembering
www.AUNewsBlog.net
www.AUNewsBlog.net
PART – B
Define exception. Why it is needed? Explain the different types of
1 exceptions and the exception hierarchy with appropriate examples BTL1 Remembering
using Java
2 What is mean by filter stream? Explain with examples BTL1 Remembering
Explain briefly about user defined exceptions and the concept of BTL1 Remembering
3 throwing and catching exception in java with examples
4 What are input and output streams? Explain them with illustrations BTL1 Remembering
5 Describe the stack trace elements with an example BTL2 Understanding
Summarize the concept of streams and stream classes and their
6 classification BTL2 Understanding
Express the most commonly used classes for handling i/o related
7 BTL2 Understanding
exceptions
How exceptions are handled in Java? Explain the important methods
8 BTL3 Applying
used to handle exception
While reading a file how would you check whether you have reached
9 BTL3 Applying
the end of the file
Explain how to handle arithmetic exception by giving a suitable
10 BTL4 Analyzing
example
Differentiate byte stream and character stream with necessary
11 BTL4 Analyzing
examples
12 Explain the importance of try - catch block with example BTL4 Analyzing
Evaluate a try block that is likely to generate three types of exception
13 and then incorporate necessary catch blocks and handle them BTL5 Evaluating
appropriately
14 Create a new directory by using File object? BTL6 Creating
PART – C
Why only read() methods in ByteArrayInputStream does not throw
1 IOException? BTL6 Creating
How does InputStream.read() method work? Can you give me some
2 sample code? BTL6 Creating
www.AUNewsBlog.net
www.AUNewsBlog.net
www.AUNewsBlog.net
www.AUNewsBlog.net
6 Discuss about translating generic expressions and calling legacy code BTL2 Understanding
7 Summarize briefly about thread synchronization with an example BTL2 Understanding
Demonstrate Inter thread Communication and suspending, resuming
8 BTL3 Applying
and stopping threads
Show how to extend thread class and how to implement runnable
9 interface for creating and starting threads? BTL3 Applying
www.AUNewsBlog.net
www.AUNewsBlog.net
3 List the methods available to draw shapes and COLOR BTL1 Remembering
4 State and Explain the basic of AWT Event handling in detail BTL1 Remembering
Describe in detail about the different layout in Java GUI. Which
5 BTL2 Understanding
layout is the default one?
Summarize the following in detail: Model, view and controller design
6 pattern with respect to Swing in Java. How MVC design pattern is BTL2 Understanding
achieved?
Discuss mouse listener and mouse motion listener. Give an example
7 BTL2 Understanding
program
Demonstrate the Characteristics of model view Controller design
8 BTL3 Applying
patterns and its advantages
9 Illustrate the usage of special fonts for text in graphics programming BTL3 Applying
i. Clasify the classes under 2D shapes (7)
10 BTL4 Analyzing
ii. Explain the Swing components in detail(6)
i. Infer JList and JComboBox with an example(7)
11 BTL4 Analyzing
ii. Compare check boxes and radio buttons with an example(6)
www.AUNewsBlog.net
www.AUNewsBlog.net
www.AUNewsBlog.net