r059210301 Oop Through Java
r059210301 Oop Through Java
1
II B.Tech I Semester Supplimentary Examinations, February 2008
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]
3. What is Inheritance? Discuss the differences in inheritances in C++ and java. [16]
6. (a) How do you scale a drawing object in java? Explain with an example java
program.
(b) What is the functionality supported by java related to colours. [8+8]
7. Explain the steps involved in creating a frame. Create a desktop pane, add it to a
frame and display two internal frames in it. Internal frames should have 2 different
layers. [8+8]
⋆⋆⋆⋆⋆
1 of 1
Code No: R059210301 Set No. 2
II B.Tech I Semester Supplimentary Examinations, February 2008
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 an array? Why arrays are easier to use compared to a bunch of related
variables?
(b) Write a program for transposition of a matrix using arraycopy command.
[6+10]
3. Create an abstract class with no methods. Derive a class and add a method. Create
a static method that takes a reference to the base class, downcasts it to the derived
class, and calls the method. In main( ), demonstrate that it works. Now put the
abstract declaration for the method in the base class, thus eliminating the need for
the downcast.
[16]
4. Write a program to create a class with a private field and a private method. Create
an inner class with a method that modifies the outer class field and calls the outer
class method. In a second outer class method, create an object of the inner class
and call it?s method, then show the effect on the outer class object. [16]
5. (a) Give the list of different checked exceptions in java and their meaning.
(b) Explain in detail any three checked exceptions. [7+9]
(a) ComponentEvent
(b) ContainerEvent
(c) FocusEvent. [6+5+5]
7. Explain the steps involved in creating a frame. Create a desktop pane, add it to a
frame and display two internal frames in it. Internal frames should have 2 different
layers. [8+8]
1 of 2
Code No: R059210301 Set No. 2
8. Explain the following methods of StringBuffer class and write a java program illus-
trating these. Length(), capacity(), SetLength(), EnsureCapacity(). [4+4+4+4]
⋆⋆⋆⋆⋆
2 of 2
Code No: R059210301 Set No. 3
II B.Tech I Semester Supplimentary Examinations, February 2008
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) Describe the genesis of java. Also write brief overview of java.
(b) Write a program to convert the given temperature in Fahrenheit to Celsius us-
ing the following conversion formula C = (F - 32)/1.8 And display the values
in a tabular form. [8+8]
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]
4. What is package? Explain the procedure to create a package with the help of
example. 16]
5. (a) Give the Class hierarchy in Java related to exception handling. Briefly explain
each class.
(b) What is the necessity of exception handling? Explain exception handling
taking “divide-by-zero” as an example. [6+10]
(a) ComponentEvent
(b) ContainerEvent
(c) FocusEvent. [6+5+5]
7. Create an applet with two toolbars. One toolbar should be created using JButtons
and a separator and another toolbar should be created using 3 custom Action
classes. Add one to the ”north” and another to the ”south” sides of border layout.
When the user clicks one of the buttons in the toolbar, it will print a message to
the console stating that which button is being pressed from which toolbar. Add
functionalities to the buttons such as New, Open, Close, Save, Cut, Copy, Paste.
[16]
1 of 2
Code No: R059210301 Set No. 3
8. (a) How different machines in a network can be addressed.
(b) What are the uses of ServerSocket class? Explain each of them with an exam-
ple. [8+8]
⋆⋆⋆⋆⋆
2 of 2
Code No: R059210301 Set No. 4
II B.Tech I Semester Supplimentary Examinations, February 2008
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 of 1