Beruflich Dokumente
Kultur Dokumente
1
II B.Tech I Semester Regular Examinations, November 2007
OOP THROUGH JAVA
( Common to Mechanical Engineering, Mechatronics, Metallurgy &
Material Technology, Production Engineering and Automobile Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆
3. What is Inheritance? Discuss the differences in inheritances in C++ and java. [16]
4. Write a program to create a class with a non default constructor and no default
constructor. Create a second class that has a method which returns a reference to
the first class. Create the object to return by making an anonymous inner class
that inherits from the first class. [16]
6. What are the components and other graphical user interface elements that can
act as source of events? What are the events that can be generated by the above
elements? Explain. [16]
⋆⋆⋆⋆⋆
1 of 1
Code No: R059210301 Set No. 2
II B.Tech I Semester Regular Examinations, November 2007
OOP THROUGH JAVA
( Common to Mechanical Engineering, Mechatronics, Metallurgy &
Material Technology, Production Engineering and Automobile Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆
1. (a) List at least five major C++ features that were intentionally removed from
java.
(b) What is World Wide Web? What is contribution of java to the World Wide
Web?
(c) How java is associated with the Internet? [6+6+4]
2. (a) What is the difference between equality of objects and equality of objects and
equality of references that refer to them?
(b) What is the difference between a public member and a private member of a
class?
(c) write an application that computes the value of ex by using the formula:
ex = 1 + x/1! + x2 /2! + x3 /3! + .......... [4+4+8]
3. (a) Define Absract class? Explain with a suitable example.
(b) Write a sample program to demonstrate the order of initialization of the base
classes and derived classes. Now add member objects to both the base and
derived classes, and show the order in which their initialization occurs during
construction. [8+8]
4. Create an interface with at least one method, and implement that interface by
defining an inner class within a method, which returns a reference to your interface.
[16]
5. (a) What is the use of five keywords of Java related to exception handling i.e.,
try, catch, throw, throws, and finally.
(b) Write an example Java program using all the five key words mentioned above,
and explain how the program works. [10+6]
6. Write a stand-alone AWT based application which creates a frame window that
responds to mouse clicks and key strokes. [16]
7. What are various JFC containers? List them according to their functionality. Ex-
plain each of them with examples. [16]
8. (a) What are sockets? Explain the classes in java with regard to sockets.
(b) What do you mean by URL? How to create an URL? [8+8]
⋆⋆⋆⋆⋆
1 of 1
Code No: R059210301 Set No. 3
II B.Tech I Semester Regular Examinations, November 2007
OOP THROUGH JAVA
( Common to Mechanical Engineering, Mechatronics, Metallurgy &
Material Technology, Production Engineering and Automobile Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆
3. Create a 3-level inheritance hierarchy. Each class in the hierarchy should have a
finalize( ) method, and it should properly call the base-class version of finalize( ).
Demonstrate that your hierarchy works properly. [16]
5. Explain how multithreading is supported in java using the thread class and the
Runnable interface. [16]
(a) Protocols
(b) Sockets
(c) Client/Server
(d) DNS. [4+4+4+4]
⋆⋆⋆⋆⋆
1 of 1
Code No: R059210301 Set No. 4
II B.Tech I Semester Regular Examinations, November 2007
OOP THROUGH JAVA
( Common to Mechanical Engineering, Mechatronics, Metallurgy &
Material Technology, Production Engineering and Automobile Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆
2. (a) What is the difference between equality of objects and equality of objects and
equality of references that refer to them?
(b) What is the difference between a public member and a private member of a
class?
(c) write an application that computes the value of ex by using the formula:
ex = 1 + x/1! + x2 /2! + x3 /3! + .......... [4+4+8]
6. With the help of an example program explain how you handle all mouse related
events. [16]
8. What is StringTokenizer class? What is its use? Write a program to display the
course name, course fee & duration of course using StringTokenizer class.[4+4+8]
⋆⋆⋆⋆⋆
1 of 1