You are on page 1of 5

1 | P a g e

Hall Ticket No
Question Paper Code : A1506
VARDHAMAN COLLEGE OF ENGINEERING
(AUTONOMOUS)
Affiliated to JNTUH, Hyderabad
Four Year B. Tech III Semester Tutorial Question Bank 2013 - 14
(Regulations: VCE-R11)
OBJECT ORIENTED PROGRAMMING THROUGH JAVA
(Common to Computer Science and Engineering & Information Technology)
PART - A (2 Marks Questions)
Unit-I
1. Define encapsulation.
2. What is the need of new operator?
3. Give the hierarchy of control statements.
4. Define a constructor. What is the need of it?
5. Define arrays.
6. What is the need of enhanced for loop?
7. Differentiate between break and continue statement.
8. Define class and object.
9. Name some string handling functions.
10. Differentiate between a constructor and method.
Unit-II
1. Write a program to demonstrate method overriding.
2. Define an abstract class.
3. Write a program to demonstrate the need of extends keyword.
4. Discuss the usage of super class in java.
5. Can a class implement more than one class? Justify.
6. What kind of inheritances not supported in java? How is it overcome?
7. What is the need of interface in java?
8. Define a package. Give the need of it in java.
9. Differentiate between final and finally.
10. What are the various contexts for which static keyword stands good?
Unit-III
1. What are the keywords involved in exception handling?
2. What are uncaught exceptions? Give an example.
3. Write a program to create your own exception.
4. Explain thread life cycle operation in java.
5. Define a thread. Does java support multithreading? Justify.
6. Differentiate between throw and throws.
7. Can a thread be implemented? Justify.
8. Define synchronization. Name the key to synchronization.
9. What is need of mutex? Define race condition.
10. Give the reason to debug the deadlock error.
Unit-IV
1. Describe the role of listener and the sources for an event.
2. Name the methods involved in the Component Listener Interface.
3. Define an adaptor class with an example.
4. Illustrate with figure the class hierarchy for Panel and Frame.
5. Give the signature of the method that is used to set windows dimensions.
6. What is the use of Font Metrics in Java?
7. What are the types of controls supported by java?
8. What is the need of inner class? Give an example.
9. Name the types of layout managers. Give the syntax of the same.
2 | P a g e
10. Give the steps involved in the usage of the delegation event model.
Unit-V
1. Name the parts of the component.
2. What are the key features of swing AWT?
3. How do you run a swing application from command line?
4. What is the variation on push button? What are the states involved in it?
5. What are the radio buttons? How many constructors does this radio button provide?
6. Give the steps followed to create a scroll pane.
7. Name the methods called when an applet is initialized?
8. Justify is it possible for a method other than paint() or update () to output to an applets window.
9. Name the different forms of repaint() method.
10. Give the syntax for fuller form of APPLET tag.
PART - B (5 Marks Questions)
Unit-I
1. Write a program to demonstrate the scope of the variables in a function scope.
2. Explain the 3 pillars of Object oriented programming.
3. Explain the JVM architecture with a neat figure.
4. Differentiate between Encapsulation and Abstraction with an example.
5. Write a program to demonstrate the working of for loop.
6. Explain autoboxing and unboxing with an example each.
7. Give the different ways in which an array can be declared?
8. What are the types of constructors? Give an example for each.
9. Write a program to change case of characters within a string.
10. Write a program to demonstrate string conversion by overriding to String() method.
11. Explain polymorphism. Explain how method overloading helps in achieving polymorphism in java.
12. What is a constructor? What is the need of constructor? How is it different from methods? Write a
program to calculate the volume of cuboid in which constructor takes 3 parameters height, width,
depth. Volume of cuboid is given by height*depth*width.
13. Write a program for stack in which initialize tos=-1 in constructor and make to methods as push()
and pop() for stack manipulation. Insert the elements 1, 2,3,4,5 in the stack and pop them to show
on the screen.
14. Explain the way of viewing the world agents to object oriented programming
15. Write a program to demonstrate the usage of parameterized constructors that sets the dimensions
of a box as specified by those parameters in finding the volume of a box .
16. Illustrate the process of compiling the java program in to the byte code & converting byte code into
machine code.
17. What is recursion? Write a program which consist of two classes, one class should consist of a
recursive method to calculate factorial and other class should call this method to calculate the
factorial of 5.
18. Explain garbage collection. Write a program to illustrate the use of this keyword in java.
19. Suppose we have a string s1=my college name is VCE. .Find the length of this String using a method
of string and then write a java program to reverse the string s1 using control statements.
20. Write a program in demonstrating the implementation of two dimensional array by displaying the
numbers of each element in the array from left to right, top to bottom
as shown below:
0 1 2 3 4
5 6 7 8 9
10 11 12 13 14
15 16 17 18 19
Unit-II
1. Demonstrate the concept of inheritance with a program.
2. What is the use of super keyword in Java. Demonstrate the usage with a program.
3. Write a program to demonstrate the method overriding.
4. Write a java program to accept the files as input and perform search on it for a keyword using
command line arguments.
3 | P a g e
5. Explain the visibility categories for class members.
6. Write a program to demonstrate the use of interface in Java.
7. Write a program to demonstrate the usage of console class.
8. Write a program to perform word count using Stream Tokenizer class.
9. Discuss the concept of serialization and deserialization with an example.
10. What are the constructors supported by Print Stream class?
11. Describe abstract class called Shape which has three subclasses say Triangle,Rectangle ,Circle. Define
one method area() in the abstract class and override this area() in these three subclasses to calculate
for specific object i.e. area() of Triangle subclass should calculate area of triangle etc. Same for
Rectangle and Circle
12. Write a program that illustrates interface inheritance. Interface P is extended by P1 and P2. Interface
P12 inherits from both P1 and P2.Each interface declares one constant and one method. class Q
implements P12.Instantiate Q and invoke each of its methods. Each method displays one of the
constants
13. Declare a class called employee having employee_id and employee_name as members. Extend class
employee to have a subclass called salary having designation and monthly_salary as members.
Define following:
-Required constructors
-A method to find and display all details of employees drawing salary more than Rs. 20000/
-Method main for creating an array for storing these details given as command line arguments and
showing usage of above methods
14. Define polymorphism with its need. Define and explain static and dynamic binding using program.
15. Discuss various levels of access protection available for packages and their implementation
16. We can create a reference to an Interface type. State true or false and justify
17. State the siginficance of following.
Static
Finalize
18. Write a program to demonstrate the multipath inheritance for the classes having
relations as shown in figure
19. Develop a Library interface which has drawbook(), returnbook() (with fine), checkstatus() and
reservebook() methods. All the methods tagged with public.
20. Write a java program to accept two file names as command line argument. Copy only those lines
from the first file to second which contains the word computer.
Unit-III
1. What is an exception handler? Write a program to issue an divide by zero message as an exception.
2. Does java support nested try statements? Justify with a sample code.
3. What is a Null pointer exception? Write a program to demonstrate the same.
4. Write a note on chained exceptions.
5. Why is main thread important in programming? What is the use of thread group?
6. Demonstrate the usage of Runnable interface with a program.
7. Does java support creation of multiple threads? Justify with a program.
8. Write a note on thread priorities.
9. What does java suggest to avoid polling? What is synchronization?
10. Demonstrate the use of finaly block in java with an example.
11. What are the ways in which we can identify that thread has finished? Write a program to
4 | P a g e
demonstrate the same.
12. Define spurious wakeup. what the consequences of spurious wakeup explain with an example.
13.
Write a program to describe the mechanism to protect a shared asset from being manipulated by more
than one thread at a time.
14.
Demonstrate Thread life cycle. List the life cycle states. Generate one thread with its full lifecycle.
15.
Differentiate checked and unchecked Exceptions. Give one example for each with programs.
16. Create a class BirthDay with parameterized constructor which takes three argument date,
month and year. Raise an exception if birthdate is invalid.
17. What is an exception? What are its types?Write a syntax for creating user defined exception class
18. Create user defined exception which is raised when number of command line
arguments less than 3.
19. a)A try block must have a catch block. State true or false and justify.
b) State difference between excetion and error
20. Write a java program which accepts email address from the user and throws an exception
Invlaid-address. If it does not containg @ symbol.
Unit-IV
1. Define an event. List the different types of component events.
2. Write a note on Key Event class.
3. Write short note on Event Listener interface.
4. Write a program to demonstrate the key event handlers.
5. Write a program to demonstrate the working of adapter class.
6. Write short note on window Fundamentals.
7. Write a simple program for showing Button Demo applet.
8. Write a sample program to create 4x4 grid and fill it with 15 buttons each labeled with its index.
9. How do you handle events in a frame window?
10.
Write the default position of the components on the window. Define the component to manually position
components within a window. Create three labels and organize them on the window.
11. Define Headless Exception. When this exception will be thrown by the component. Explain any
components which throws HeadlessException.
12. Create the component is used to create a set of mutually exclusive options in which one and only
one option in the options can be checked at any one time.
13. Write the two general forms for add() of List component. Create a list of items in which user can
select two or more items from the list.
14. Define TextField and TextArea components with an example each.
15. List some Event classes. Write a program to generate Action event when a button is pressed, a list
item is double-clicked, or a menu item is selected.
16. What are the key types of Events? Write a program to type a character by generating key event.
17. Write a program to generate a mouse wheel event to scroll unit or block type.
18. List the types of Window events. Create an event which will window was deiconified and iconified.
19. Explain about Anonymous Inner Classes. Illustrates how an
Anonymous inner class can facilitate the writing of event handlers.
20. Write about Event Delegation model. Explain about ItemEvent class to select single item or multiple
items using checkbox component.
Unit-V
1. Write notes on different types of layouts.
2. Give the skeleton of the applet with an example.
3. Write a program to demonstrate passing parameters.
4. Write notes on features of Swing.
5. Write a sample program to demonstrate swing application.
6. Illustrate with an example creation of swing applet.
7. Write a note on JText Field.
8. Demonstrate the working of Jtoggle Button.
9. Elaborate on procedure to use tabbed pane.
10. Elaborate on the steps required to set up simple Jtable used to display data.
11. Differentiate applet and application programs with an example.
12. Explain the structure of window based Applet. Write applet skeleton.
5 | P a g e
13. Demonstrate repaint() with simple applet which scrolls a message right to left across the applet
window.
14. Write a program to pass parameters to the applet through HTML tag.
15. Create a simple applet window whose background is green and foreground is black, which displays a
simple message this is assignment test on the status window.
16. What are the two types of applets. Explain each with a simple applet program Label and JLabel
components.
17. Using JToggleButton component create a swing with button, that toggles between two states
pressed and released.
18. How to manage the scrollbars for group of components by eliminates the need
to manage individual scroll bars. Explain with an Example.
19. Create a tree which consists of hierarchical subtrees of components. Collapse one individual
subtree by using JTree class.
20. Create a table with 3 rows and 3 columns such that resize the boundaries of columns and rows and
also we can select the data from one cell and drag to other cell by using JTable.

You might also like