CS8392-Object Oriented Programming QB
CS8392-Object Oriented Programming QB
net
QUESTION BANK
et
SUBJECT : CS8392 -OBJECT ORIENTED PROGRAMMING
.n
SEM/YEAR : III / II
pz
Object Oriented Programming - Abstraction – objects and classes - Encapsulation- Inheritance -
Polymorphism- OOP in Java – Characteristics of Java – The Java Environment - Java Source File -
Structure – Compilation. Fundamental Programming Structures in Java – Defining classes in Java –
constructors, methods -access specifiers - static members -Comments, Data Types, Variables,
ee
Operators, Control Flow, Arrays , Packages - JavaDoc comments.
PART-A
Q.No Questions BT Level Competence
1 Express what is meant by Object Oriented Programming. BTL 2 Understand
2 Compare class and object. BTL 4 Analyze
List the core OOP’s concepts.
ad
3 BTL 1 Remember
4 Tabulate the difference between C++ and Java. BTL 1 Remember
5 Discuss what is meant by abstraction. BTL 2 Understand
6 Describe about Encapsulation, Inheritance and BTL 2 Understand
Polymorphism.
Point out the justification of the statement “Java is platform
.p
7 BTL 4 Analyze
independent”.
8 Express a Java programming structure to display “Hello BTL 2 Understand
World”.
w
www.padeepz.net
www.padeepz.net
PART B
et
ii.Describe variables and operators in Java. (6)
4. Define and explain the control flow statements in Java with (13) BTL 1 Remember
suitable examples
5 What is meant by constructor? Discuss the types of (13) BTL 2 Understand
.n
constructor with example.
6 i.Analyse and Develop a simple Java program to sort the (7) BTL 4 Analyze
given numbers in increasing order.
ii.Write a Java program to reverse the given number. (6)
pz
7 i. Classify the characteristics of Java. (6) BTL 3 Apply
ii.Illustrate the working principles of Java Virtual Machine.
iii.Show with an example the structure of Java Program (4)
(3)
8 i.Summarize about access specifier in Java. (7) BTL 2 Understand
ee
ii.Describe the term static fields and methods and explain its
types with example. (6)
9 i) Define Arrays. What is array sorting and explain with an (7) BTL 1 Remember
example.
ii)Tabulate and explain documentation comments in Java. (6)
ad
10 Illustrate what is meant by package? How its types are (13) BTL 3 Apply
created and implemented in Java.
11 Write the techniques to design classes in Java using (13) BTL 6 Create
JavaDoc.
12 Explain with example passing objects as parameters to (7) BTL 4 Analyze
methods and returning objects from methods in Java. (6)
.p
PART C
1 Develop a Java application to generate Electricity bill. Create (15) BTL 6 Create
a class with the following members: Consumer no., consumer
name, previous month reading, current month reading, type of
w
www.padeepz.net
www.padeepz.net
2 Evaluate a Java program to find a smallest number in the (15) BTL 5 Evaluate
given array by creating one dimensional array and two
dimensional array using new operator.
3 Explain class hierarchy and explain its types with suitable (15) BTL 5 Evaluate
examples.
4 Develop a Java application with Employee class with (15) BTL 6 Create
Emp_name, Emp_id, Address, Mail_id, Mobile_no as
members. Inherit the classes, Programmer, Assistant
et
Professor, Associate Professor and Professor from employee
class. Add Basic Pay (BP) as the member of all the inherited
classes with 97% of BP as DA, 10 % of BP as HRA, 12% of
BP as PF, 0.1% of BP for staff club fund. Generate pay slips
.n
for the employees with their gross and net salary.
pz
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, Array Lists – Strings
PART-A
Q.No Questions BTL Competence
ee
Level
1 Examine the importance of inheritance. BTL 3 Apply
2 Summarize the characteristics of constructor function. BTL 4 Analyze
3 What is a default constructor? Illustrate. BTL 3 Apply
4 Identify what are the two ways of using super keyword. BTL 1 Remember
ad
abstract classes.
9 Give the use of final keyword. BTL 2 Understand
10 Generalize what is protected visibility. BTL 6 Create
11 Define interface and write the syntax of the interface BTL 1 Remember
w
14 Describe whether you can have an inner class inside a method BTL 1 Remember
and what variables can you access.
15 Differentiate between abstract class and interface. BTL 2 Understand
w
www.padeepz.net
www.padeepz.net
et
with suitable example.
6 i. Discuss the concept of abstract class. (7) BTL 2 Understand
ii.Give a program for abstract class with example. (6)
.n
7 i. Explain briefly on final keyword. (7) BTL 4 Analyze
ii.Explain the concept of abstract class with an example. (6)
pz
ii.How is interface declared and implemented in Java. Give
example. (6)
9 i. Differentiate classes with interface with suitable examples. (7) BTL 2 Understand
ii. Express a Java program for extending interfaces. (6)
10 Define inner classes. How to access object state using inner BTL 1 Remember
ee
classes? Give an example. (13)
11 i. Explain with an example what is meant by object cloning? (7) BTL 5 Evaluate
ii. Summarize in detail about inner class with its usefulness. (6)
12 Analyse and write a Java program using arrayListclasses and BTL 4 Analyze
ad
14 Illustrate String handling class in Java with example. (13) BTL 3 Apply
PART C
1 Develop a program to perform string operations (15) BTL 6 Create
using ArrayList. Write functions for the following
w
www.padeepz.net
www.padeepz.net
et
contains only the method print Area () that prints the area
of the given shape.
UNIT III-EXCEPTION HANDLING AND I/O
.Exceptions - exception hierarchy - throwing and catching exceptions – built-in exceptions, creating
.n
own exceptions, Stack Trace Elements. Input / Output Basics – Streams – Byte streams and
Character streams – Reading and Writing Console – Reading and Writing Files
PART-A
Q.No Questions BT Level Competence
pz
1 Interpret what is an Exception. What is its use? BTL 2 Understand
2 Predict what function does terminate and unexpected BTL 2 Understand
handlers call.
3 What is re-throwing an expression? BTL 1 Remember
4 Define uncaught exception. BTL 1 Remember
ee
5 Summarize the task performed by exception handling. BTL 2 Understand
6 Differentiate exception and error BTL 2 Understand
7 Classify the exception types with example BTL 4 Analyze
8 Draw the exception hierarchy. BTL 5 Evaluate
9 What are the two methods available in stack trace elements? BTL 1 Remember
ad
1 Discuss in detail about exception handling constructs and (13) BTL 2 Understand
write a program to illustrate Divide by zero exception.
2 Describe the following concepts with example BTL 1 Remember
i. Try-catch-throw paradigm. (7)
ii.Exception specification. (6)
3 Describe about the syntax of catch and re-throw an (13) BTL 1 Remember
www.padeepz.net
www.padeepz.net
et
7 Analyse the following in detail with example program BTL 4 Analyze
i.Checked Exception (7)
ii.Unchecked exception (6)
8 i.Classify the errors and exception in Java. (7) BTL 3 Apply
.n
ii.Illustrate about multiple catching exceptions with example. (6)
9 Summarize the following with example program BTL5 Evaluate
i.Arithmetic exception (5)
ii.Arrayoutofbound exception (4)
pz
ii.Stringindexoutofbound exception (4)
10 i. Develop a program to read and count the characters from BTL 6 Create
files. (7)
ii.Develop a Java program to transfer the content of one file to
another file. (6)
ee
11 Discuss briefly about the features BTL 2 Understand
i. Byte streams input/output (7)
ii. Character streams input/output (6)
12 Explain the following with example BTL 4 Analyze
i. Reading console input (7)
ad
2 i.Custom exception has been created in the code given below. (15) BTL 5 Evaluate
Correct and evaluate the code
Class myexception extends Exception
w
{
Myexception(string s)
{
super(s)
w
}
}
Class excep
{
Public static void main(String args[])
{‘ if(args[0]== “Hello”)
System.out.println(“String is right”);
www.padeepz.net
www.padeepz.net
else
try
{
Throw new myexception(“Invalid string”);
}
Catch(myexception ex)
{
System.out.println(ex.gemessage());
et
}
}
}
ii.The program calculates sum of two numbers inputted as
.n
command-line arguments.When will it give an exception?
Class execp
{
Public static void main( String []args)
pz
{
try{
int n= Integer.parseInt(arg[0]);
int n1=Integer.parseInt(arg[1]);
int n2=n+n1;
ee
System.out.println(“Sum is:” +n2);
}
Catch(NumberFormatException ex)
{
System.out.println(ex);
ad
}
}
}
3 Develop the Java program to concatenate the two files and (15) BTL 6 Create
produce the output in the third file
.p
4 Deduce a Java program that reads a file name from the user, (15) BTL 5 Evaluate
displays information about whether the file exists, whether the
file is readable, or writable, the type of file and the length of
the file in bytes.
w
UNIT IV
Differences between multi-threading and multitasking, thread life cycle, creating threads,
synchronizing threads, Inter-thread communication, daemon threads, thread groups. Generic
w
Programming – Generic classes – generic methods – Bounded Types – Restrictions and Limitations.
PART-A
Q.No Questions BT Level Competence
w
www.padeepz.net
www.padeepz.net
et
16 Give the methods used for inter thread communication. BTL 2 Understand
17 Classify what are three ways in which a thread can enter the BTL 4 Analyze
waiting state?
18 Generalize what is daemon thread and which method is used BTL 6 Create
.n
to create the daemon thread.
19 Differentiate between yielding and sleeping. BTL 4 Analyze
20 Illustrate what is thread group. BTL 3 Apply
PART-B
pz
1 Describe in detail about multithread programming with (13) BTL 1 Remember
example.
2 i.Differentiate multithreading and multitasking. (7) BTL 2 Understand
ii.Describe the properties of thread in detail. (6)
3 Summarize the two types of thread implementation BTL 2 Understand
ee
supported by Java .Give example. (13)
4 i.Illustrate the concept of synchronization in thread. (7) BTL 3 Apply
ii.Write a Java code for reader writers problem. (6)
5 i. Describe how to implement runnable interface for creating BTL 1 Remember
and starting threads. (7)
ad
ii.List the inheritance rules for generic types with example. (6)
11 i.Give the limitations of generic programming. (7) BTL 4 Analyze
ii.Explain any two restriction of generic programming in (6)
detail with suitable example.
12 Describe the following BTL 1 Remember
i.Generic class (7)
ii.Generic method (6)
www.padeepz.net
www.padeepz.net
13 Illustrate generic code and the virtual machine with suitable (13) BTL 3 Apply
example
14 Summarize thread group. How to implement the thread (13) BTL 2 Understand
group. Explain it with example.
PART C
1 Generalize multithreading for an sample sequence of strings (15)
with a delay of 1000 millisecond for displaying it using Java BTL 6 Create
threads
et
2 Deduce a Java program to perform the following tasks using (15)
three different threads. Each thread will be responsible for its
own task only. Among these three threads one will find the
average number of the input numbers, one will be responsible BTL 5 Evaluate
.n
for finding the Maximum number from the input array of
numbers, and one will be responsible for finding the
Minimum number from the input array of numbers.
3 Develop a simple generic class example with two type (15) BTL 6 Create
pz
parameters. so that we can define two types of parameters
called U & V, separated by ",".
– Dialog Boxes.
PART-A
Q.No Questions BT Level Competenc
e
1 List out some system colors available in Java and their BTL 1 Remember
.p
purpose.
2 Give the role of layout manager. Which layout is default in BTL 2 Understand
Java? Define Border layout.
3 Give the steps needed to show a Frame. BTL 2 Understand
w
8 Recommend what method can be used for changing case of BTL 5 Evaluate
characters.
9 Formulate the swing components. BTL 6 Create
10 Differentiate between Swing and AWT. BTL 4 Analyze
11 Generalize what is an event and what are the models BTL 6 Create
available for event handling.
12 List the difference between scrollbar and scrollpane. BTL 1 Remember
13 Differentiate between a Choice and a List. BTL 2 Understand
www.padeepz.net
www.padeepz.net
14 Quote how can you create your own GUI components. BTL 1 Remember
15 Analyse what is the purpose of the enableEvents() method? BTL 4 Analyze
16 Write a program to print the names of all fonts on your BTL 3 Apply
system.
17 Show the methods of frame class. BTL 3 Apply
18 Deduce the structure of AWT Event Hierachy. BTL 5 Evaluate
19 Give what is JRadioButton and its constructor BTL 2 Understand
20 Show what method can be used for changing font of BTL 3 Apply
et
characters?
PART-B
1 i.Describe in detail about working with 2D shapes in Java. (7) BTL 1 Remember
ii. Identify a Java program to illustrate Mouse Events. (6)
.n
2 i..Describe in detail about swing Components. (7) BTL 1 Remember
ii.Describe the types of layout management. (6)
3 Summarize in detail about graphics programming. (13) BTL 2 Understand
pz
4 i. Discuss how an application can respond to events in Java? (7) BTL 2 Understand
Write the steps and the example.
ii.Discuss the adapter class using example. (6)
5 What is meant by event handling? Analyse and write a simple (13)
calculator using mouse events that restrict only addition, BTL 4 Analyze
ee
subtraction, multiplication and division.
6 Tabulate the controller design pattern and components of (13) BTL 1 Remember
swing briefly.
7 i. Illustrate what is layout management? State the various (7) BTL 3 Apply
types of layout supported by Java? Which layout is default
one? (6)
ad
PART C
1 Develop a Java program to implement the following (15)
Create four check boxes. The initial state of the first box
should be in checked state. The status of each check box BTL 6 Create
should be displayed. When we change the state of a check
box, the status should be displayed and updated.
2 Develop a Java program to display the following picture as (15) BTL 6 Create
www.padeepz.net
www.padeepz.net
output.
et
.n
3 Evaluate a Java program for event handling using (15) BTL 5 Evaluate
actionlistener interface
pz
ee
4 Recommend a Java swing with one button and adding it on (15) BTL 5 Evaluate
the JFrame object inside the main() method.
ad
.p
w
w
w
www.padeepz.net