0% found this document useful (0 votes)
84 views10 pages

QB

This document contains a question bank for the course CS8392 - Object Oriented Programming. It includes questions divided into three parts - Part A (2 marks), Part B (13 marks) and Part C (15 marks). The questions cover topics related to OOP concepts like classes, objects, inheritance, interfaces and exception handling. Some example questions are on defining objects and classes, features of Java language, exception types and hierarchy, I/O stream classes and exception handling mechanisms in Java.

Uploaded by

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

QB

This document contains a question bank for the course CS8392 - Object Oriented Programming. It includes questions divided into three parts - Part A (2 marks), Part B (13 marks) and Part C (15 marks). The questions cover topics related to OOP concepts like classes, objects, inheritance, interfaces and exception handling. Some example questions are on defining objects and classes, features of Java language, exception types and hierarchy, I/O stream classes and exception handling mechanisms in Java.

Uploaded by

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

ADITHYA INSTITUTE OF TECHNOLOGY

COIMBATORE – 641 107


Degree: B.Tech. & Branch: IT
Semester: 03 & Year: II
CS8392 – OBJECT ORIENTED PROGRAMMING
Question Bank
UNIT: 1 – INTRODUCTION TO OOP AND JAVA FUNDAMENTALS

PART – A (2 MARKS)
1. What is Programming Paradigm?
2. What is Object Oriented Programming?
3. What are important features in object-oriented programming and design?
4. How could Java classes direct program messages to the system console, but error messages,
say to a file?
5. What's the difference between an interface and an abstract class?
6. Why would you use a synchronized block vs. synchronized method?
7. State the usage of the keyword transient?
8. Define object and object variable ?(Apr/May 2011)(May/June 2013)
9. What is meant by private access specifier? (Nov/Dec 2011)
10. What is the need for javadoc multiline comments. (Nov/Dec 2011)
11. Define Constructor. (Nov/Dec 2011)
12. What is a class? (Nov/Dec 2011)
13. What are the fundamental features of object-oriented programming?
14. What is Encapsulation?
15. What is a Type?
16. What is a class Members?
17. What is meant by Access Specifiers?
18. Define the Static Class Method.
19. How to Write a Finalize method using Java. (May/June 2013)
20. What is an array? How to declare an array in java?
21. What is the use of Strings in Java?
22. Write about String Tokenizer?
23. Define Java Packages.
24. What is JavaDoc? (Nov/Dec 2011)
25. Mention the types of the JavaDoc.
26. Mention the purpose of finalize method. (May/June 2013)
27. How to access member variables from the class?
28. Write about Java I/O Package?

PART – B (13 MARKS)


1. Explain OOP Principles.
2. Explain the features of Java Language.
3. Compare and Contrast Java with C.
4. Compare and Contrast Java with C++.
5. Explain Constructors with examples.
6. Explain the methods available under String and String Buffer Class.
7. Explain the Date Class methods with examples.
8. Discuss in detail the access specifiers available in Java.
9. Explain the different visibility controls and also compare with each of them.
10. Explain the different methods in java.Util.Arrays class with example.
11. Explain Packages in detail.
12. Discuss the methods under Array Class.

PART-C (15 MARKS)


1. Discuss some of the classes available under Lang package and develop your own
applications.
2. Illustrate with examples: static and final.
3. Explain method overriding with example program.
4. What is javaDoc? Explain the comments for classes, methods, fields and link.
5. Develop library application Programs using fundamental concepts in Java.
ADITHYA INSTITUTE OF TECHNOLOGY
COIMBATORE – 641 107
Degree: B.Tech. & Branch: IT
Semester: 03 & Year: II
CS8392 – OBJECT ORIENTED PROGRAMMING
Question Bank
UNIT: 2 – INHERITANCE AND INTERFACES

PART – A (2 MARKS)
1. Define Inheritance. May/June 2012
2. What are the conditions to be satisfied while declaring abstract classes?
3. You can create an abstract class that contains only abstract methods. On the other hand, you
can create an interface that declares the same methods. So can you use abstract classes
instead of interfaces?
4. Define Polymorphism.
5. Write about Virtual methods.
6. What is Static Binding?
7. What is Dynamic binding?
8. What is an Abstract classes and Methods?
9. When an Abstract Class Implements an Interface?
10. What is Object Class?
11. What is an interface? (Nov/Dec 2011)
12. What are the uses of Interfaces? (Nov/Dec2010)
13. Why Interfaces Do not Provide Multiple Inheritances?
14. What is meant by Reflection API?
15. What are the uses of Reflection?
16. What are the Drawbacks of Reflection?
17. What is object cloning in Java? (May/June 2013)
18. Define Inner classes. (Apr/May 2011)
19. What are the properties of proxy class?
20. What is final modifier? (May/June 2013)

PART B (13 MARKS)


1. Explain the concept of inheritance and its types.
2. Explain the concept of overriding with examples.
3. What is dynamic binding? Explain with example.
4. Explain the uses of reflection with examples.
5. Define an interface. Explain with example.
6. Explain the methods under “object” class and “class” class.
7. What is object cloning? Explain deep copy and shallow copy with examples.
8. Explain static nested class and inner class with examples.
9. With an example explain proxies.
10. Develop a message abstract class which contains playMessage abstract method. Write a
different sub-classes like TextMessage, VoiceMessage and FaxMessage classes for to
implementing the playMessage method.
11. Develop a abstract Reservation class which has Reserve abstract method. Implement the sub-
classes like ReserveTrain and ReserveBus classes and implement the same.
12. Develop an Interest interface which contains simpleInterest and compInterest methods and
static final field of Rate 25%. Write a class to implement those methods.
13. Develop a Library interface which has drawbook(), returnbook() (with fine), checkstatus() and
reservebook() methods. All the methods tagged with public.
14. Develop an Employee class which implements the Comparable and Cloneable interfaces.
Implement the sorting of persons (based on name in alphabetical). Also implement the
shallow copy (for name and age) and deep copy (for DateOfJoining).
15. Explain the different methods supported in Object class with example.

Part-C 15 MARK
1. Develop a static Inner class called Pair which has MinMax method for finding min and max
values from the array.
2. Explain the following with examples(NOV/DEC 2010)
i. The clone able interface(8)
ii. The property interface. (7)
3. Develop an application using inheritance and interfaces
4. Develop a book application and apply various string operations to find particular string.
5. With the help of real time application explain object cloning in java.
ADITHYA INSTITUTE OF TECHNOLOGY
COIMBATORE – 641 107
Degree: B.Tech. & Branch: IT
Semester: 03 & Year: II
CS8392 – OBJECT ORIENTED PROGRAMMING
Question Bank
UNIT: 3 – EXCEPTION HANDLING AND I/O

PART – A (2 MARKS)
1. What is an Exception?
2. Write down the purpose of exception handling mechanism.
3. What are the types of exceptions?
4. How the exception handling is managed?
5. Write down the general form of an exception-handling block.
6. What are the two subclasses under Throwable class?
7. What is an Error?
8. What is an Exception?
9. Draw the diagrammatical representation for Exception Hierarchy
10. Write down the use of try and catch block in exception handling.
11. Explain the situation where we need to use multiple catch clauses.
12. Write down the syntax for multiple catch clauses.
13. Explain the situation where we need to use nested try statements.
14. Write down the syntax for nested try statement. {
15. Write down the use of throw statement.
16. Write down the use of throws clause.
17. Write down the use of finally clause.
18. What is Unchecked Exception?
19. What is Checked Exception?
20. Write down some of the unchecked exceptions in
21. Write down some of the checked exceptions in RuntimeException?
22. List the way to create own exceptions.
23. Define Stack Trace Elements.
24. List out the methods in StackTraceElements
25. What is meant by a stream?
26. What are the two types of streams?
27. What are the predefined stream variables in System class?
28. What is meant by a byte stream?
29. What are abstract classes in byte streams?
30. List out some of the Byte Stream Classes.
31. What is meant by a Character stream?
32. What are abstract classes in Character streams?
33. List out some of the Character Stream Classes.
34. How to read a character from BufferedReader Class?
35. How to read the string from BufferedReader Class?
36. What is the use of PrintWriter class?
37. Write the use of FileInputStream class
38. Write down the methods in FileInputStream Class.
39. Write the use of FileOutputStream class.
40. Write down the methods in FileOutputStream Class.

PART B (13 MARKS)


1. Explain the Throwing and Catching Exception.
2. What is exception? How to throw an exception? Give an example.
3. What is finally class? How to catch exceptions? Write an example.
4. What is meant by exceptions? Why it is needed? Describe the exception hierarchy.
5. Write note on Stack Trace Elements. Give example.
6. Define Exception and explain its different types with example.
7. Discuss about character stream classes.
8. With suitable coding discuss all kinds of exception handling.
9. Write a note on java.io package with its stream classes and methods in it.
10. Write a Java program to demonstrate I/O character stream classes.
11. Write short notes on PrintStream class.
12. Explain how user-defined exception subclasses are created in Java.

PART C (15 MARKS)


1. What is the necessity of exception handling? Explain exception handling taking “Divide –by
Zero” as an example.
2. What is an exception? Create your own exception for “Temperature>40” in an “Atomic
Reactor Based Application” and write appropriate exception handling code in the main
program.
3. Write a Java program to copy the data from one file to another file.
4. Write a program that uses a sequence input stream to output the contents of two files.
5. List the five keywords in Java exception handling. Describe the use of the keywords.
ADITHYA INSTITUTE OF TECHNOLOGY
COIMBATORE – 641 107
Degree: B.Tech. & Branch: IT
Semester: 03 & Year: II
CS8392 – OBJECT ORIENTED PROGRAMMING
Question Bank
UNIT: 4 – MULTITHREADING AND GENERIC PROGRAMMING

PART – A (2 MARKS)
1. Differentiate multitasking and multithreading.
2. What is thread?
3. Write the states of a thread.
4. Draw the life cycle of thread.
5. What is the role of Newborn State?
6. What is the role of Runnable State?
7. Write down the role of Running State.
8. Write down the role of Blocked State.
9. Write down the role of Dead State.
10. What are the ways of creating threads?
11. What are the methods in Thread class?
12. What is the difference between yielding and sleeping?
13. Can I implement my own start() method?
14. How do you set the priority to a thread?
15. How to synchronize the threads in Java?
16. Write the purpose of using synchronization in threads?
17. What are the types of Thread Synchronization?
18. Write down the use synchronized method.
19. What is the use of synchronized block?
20. What is the use of static synchronization block?
21. What is meant by Daemon thread in Java?
22. How does the interprocess communication happen?
23. Write down the purpose of using Daemon thread in java.
24. What are the methods of daemon thread?
25. What is meant by ThreadGroup?
26. Write down the constructors of ThreadGroup.
27. Write down some of the methods in ThreadGroup.
28. Write the purpose of using generic programming.
29. What is meany by generic class?
30. What is meany by generic method?
31. Write down the rules to define Generic methods.
32. Write down the use of bounded type parameters.
33. What is meant by Wild Card argument?
34. What is meant by Bounded Wildcards?

PART B (13 MARKS )


1. What is thread? Explain the life cycle of threads.
2. Write short notes on synchronization.
3. Explain the properties of thread in detail.
4. Explain in detail about generic classes and methods.
5. Write the difference between multithreading and multitasking. What are the ways of creating a
thread in Java?
6. Explain various Java functions which support inter-process communication.
7. Write a program to create a thread by implementing Runnable interface.
8. Explain the life cycle of thread and synchronization with a neat diagram.
9. What is multithreading? Write a Java program to create multiple threads.
10. Develop a program to create multiple threads using isAlive() and join method.
11. Explain in detail about generic inheritance and generic interfaces. Discuss exploring the
impact of inheritance in generic classes with example.
12. Write about inheritance rules for generic types with example.

PART C (15 MARKS)


1. Define thread. Explain the states of thread briefly. State the reasons for synchronization in
thread. Write a simple concurrent programming to create, sleep, and delete the threads.
2. State the motivations of generic programming. Explain the generic classes and methods with
example.
3. Write a Java program to display the different combinations of 20-20 cricket teams with team
member names using multithreading.
4. Write a Java program that correctly implements producer consumer problem using the concept
of inter thread communication
5. How will you resolve deadlock in Interthread communication?
ADITHYA INSTITUTE OF TECHNOLOGY
COIMBATORE – 641 107
Degree: B.Tech. & Branch: IT
Semester: 03 & Year: II
CS8392 – OBJECT ORIENTED PROGRAMMING
Question Bank
UNIT: 5 – EVENT DRIVEN PROGRAMMING

PART – A (2 MARKS)

1. How are frames created in java?


2. What is adapter class?
3. Give the value for the following predefined actions.
4. State the functions of action in event handler.
5. What are the methods under WindowListener Interface?
6. What is reflection?
7. Write about toString method of object class?
8. Give the syntax of drawImage() and copyArea() methods.
9. What are the methods under reflection used to analyse the capabilities of classes?
10. What is Class.forName() does and how it is useful?
11. What are classes in Graphics Programming?
12. List the types of events occur in a graphic based Program.
13. Write about Component with example.
14. Write about about graphics in the Java 2 platform.
15. What is an Event Listener?
16. What is an adapter?
17. What is an action in Java?
18. Difference between Awt and Swing Package.
19. What is the use of Mouse Event?
20. What is ActionEvent?
21. What is AdjustmentEvent?
22. What is ComponentEvent?
23. What is ContainerEvent?
24. What is FocusEvent?
25. What is Input Event?
26. What is Item Event?
27. What is KeyEvent?
28. What is Swing?
29. What are the Features of Swing?
30. Write about the Swing Components?
31. List the various types of Layout Management.

PART - B (13 MARKS)


1. Explain the AWT Event handling in detail.
2. Give the methods available in graphics for COLOR.
3. List the methods available to draw shapes.
4. Explain frame components with examples.
5. Elaborately discuss the components of graphics programming. Illustrate the basic of event
handling.
6. Describes the types of layout management and swing components briefly.
7. Explain in detail about Graphic Programming.
8. Write a Java program to illustrate Mouse Events.
9. What is swing? Write a program for a simple calculator using swing.
10. Discuss the adapter classes using example.
11. Explain about the concepts of creating and positioning of frame.
12. Define Event handling. Write a program to handle a button event.

PART – C (15 MARKS)


1. What are called as event listeners? Create an Applet for ―Patient Registration
System with Grid Layout and do the action events for mouse and key events.
2. Explain in detail about AWT classes with syntax and examples.
3. Write a program using various AWT controls to design a form which accepts the
details of a user.
4. Explain the Action Event and the Action Listener class of Event package.

Prepared By
Rupilaa V M

You might also like