II B.Tech II Semester, Regular Examinations, April – 2012
OBJECT ORIENTED PROGRAMMING THROUGH JAVA
(Com. to CSE, IT, ECC)
Time: 3 hours Max. Marks: 75
Answer any FIVE Questions
All Questions carry Equal Marks
~~~~~~~~~~~~~~~~~~~~~~
1. a) How to create and execute a java program? Explain with an example.
b) What do you understand by dynamic method dispatch? Explain with the help of an example.2. a) What is meant by overloading methods? What are the advantages of overloading concept?
b) Write about automatic type conversion and explain when casting is needed with an example.
3. a) Discuss why casting a super class reference to a subclass reference is potentially dangerous.
b) How multiple inheritance is achieved in Java? Explain with an example.
4. a) What is interface? What are the possible contents of an interface? Explain.
b) List the differences between Interface and abstract class.
5. a) Write a java program to create a thread that displays odd numbers starting from 1 to 100.
b) Is it essential to catch all types of exceptions? Justify your answer.
6. Design an applet to display three buttons “Red”, “green”, and “blue”. The color of the back
ground changes according to the button presses by the user. Also, write the HTML code to
display the applet.
7. a) With an example show the handling of mouse events in JAVA.
b) Briefly explain AWT class hierarchy.
8. a) Write short notes on following: Components and containers
b) Write a java program for creating tables using swings.
II B.Tech II Semester, Regular Examinations, April – 2012
OBJECT ORIENTED PROGRAMMING THROUGH JAVA
(Com. to CSE, IT, ECC)
Time: 3 hours Max. Marks: 75
Answer any FIVE Questions
All Questions carry Equal Marks
~~~~~~~~~~~~~~~~~~~~~~
1. a) Explain in detail the following principles of object oriented programmingi) Data encapsulation and data hiding ii) Inheritance and polymorphism
b) What is byte code? Explain its usefulness while translating a Java program in a wide
variety of environments.
2. a) Explain the different types of decision making and branching statements with an example.
b) What is a constructor? What are its special properties?
3. a) Create an abstract base class shape with two members base and height, a member function
for initialization and a pure virtual function to compute area ( ). Derive two specific classes
Triangle and Rectangle which override the function area ( ). Use these classes in a main
function and display the area of a triangle and a rectangle.
b) What is the difference between method overriding and method overloading? Explain with
example. [
4. a) What is interface? What are the possible contents of an interface? Explain. State the
advantages of using interface
b) List the differences between Interface and abstract class.
5. a) Define Thread and explain the implementation of thread with an example program.
b) What is finally block? Discuss the utility of using the finally block with an example.
6. a) Write the steps for creating and executing an applet program with an example.
b) Why do applet classes need to be declared as public? How many arguments can be passes to
an applet using <param> tag?
7. a) Explain the delegation event modes? Explain the role of source and listeners with an
example.
b) Briefly explain various types in the layout manager with suitable examples.
8. a) What is AWT? Give the limitations of AWT.
b) Briefly explain MVC architecture.
II B.Tech II Semester, Regular Examinations, April – 2012
OBJECT ORIENTED PROGRAMMING THROUGH JAVA
(Com. to CSE, IT, ECC)
Time: 3 hours Max. Marks: 75
Answer any FIVE Questions
All Questions carry Equal Marks
~~~~~~~~~~~~~~~~~~~~~~
1. a) Explain the difference between an object and a class?b) What is the use of finalize () method? What is its disadvantage?
2. a) Explain creating and accessing class members using object with an example.
b) List and explain any five string functions with an example program.
3. a) Discuss about different forms of inheritance with an example.
b) Why should you use the keyword super in your java program? Explain with example
4. a) Explain the implementation of runnable interface with an example.
b) Show with an example, how you can organize two classes in two different files into a single
package.
5. a) What is exception handling? I sit necessary to have it in a java program? Justify with an
example.
b) Write down the ways by which Java can create multiple threads.
6. a) Explain in detail about Applet life cycle.
b) Develop an applet that receives two numerical values as input from the user and then
displays the sum of these numbers on the screen. Write the HTML code that calls the applet.
7. a) What is an event? Explain different components of an event?
b) Discuss MouseListenener interface and list out its functions.
8. a) Make an inheritance diagram of the AWT event classes. What is meant by Semantic and
Low-level events in the AWT? List various semantic and low-level event classes in
java.awt.event package.
b) Write short notes on following: JFrame, JButton
1 of 1
II B.Tech II Semester, Regular Examinations, April – 2012
OBJECT ORIENTED PROGRAMMING THROUGH JAVA
(Com. to CSE, IT, ECC)
Time: 3 hours Max. Marks: 75
Answer any FIVE Questions
All Questions carry Equal Marks
~~~~~~~~~~~~~~~~~~~~~~
1. a) Explain the basic characteristics of object oriented programming.b) What is a class? How does it accomplish data hiding?
2. a) Explain different types of control statements available in object oriented programming.
b) What is a constructor? Is constructor overloading possible? Explain with an example.
3. a) What are the differences between abstract class and interface?
b) Discuss the relative merits of using protected access vs. private access in super class.
4. a) How to create and import a package? Explain with an example.
b) Is it possible to partially implement an interface? Justify your answer with example.
5. a) Write a java program to implement the following exception class.
i) Arithmetic Exception
ii) Number Format Exception
iii) Array Index Out of Bounds Exception
b) What are the two methods by which threads can be stopped? Describe these methods.
6. a) Explain the role of Java applets in designing a web page.
b) List various attributes of Applet tag used in HTML. Explain the purpose of these attributes
7. a) Explain different types of methods and constructors present in the CheckBox Class.
b) What is border layout? Write a java program which creates border layout and adds two text
boxes to it.
8. a) List Three UI components of swing and their classes and constructors.
b) How java swing controls differs from java AWT controls.
1 of 1
No comments:
Post a Comment