r05220402 Oop Through Java
r05220402 Oop Through Java
1
II B.Tech Supplimentary Examinations, Aug/Sep 2008
OOP THROUGH JAVA
( Common to Electronics & Communication Engineering, Computer Science
& Engineering, Information Technology, Computer Science & Systems
Engineering, Electronics & Telematics and Electronics & Computer
Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆
1. (a) List the eight data types used in Java. Give examples.
(b) Write a while loop to find the smallest n such that n2 is greater than 10,000.
[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. What is Error? What is Exception? Are they totally different or related? As a pro-
grammer what is the difference in handling an error and an exception. With the help
of a simple java program explain the concepts error and exception. [2+2+2+4+6]
(a) ComponentEvent
(b) ContainerEvent
(c) FocusEvent. [6+5+5]
⋆⋆⋆⋆⋆
1 of 1
Code No: R05220402 Set No. 2
II B.Tech Supplimentary Examinations, Aug/Sep 2008
OOP THROUGH JAVA
( Common to Electronics & Communication Engineering, Computer Science
& Engineering, Information Technology, Computer Science & Systems
Engineering, Electronics & Telematics and Electronics & Computer
Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆
⋆⋆⋆⋆⋆
1 of 1
Code No: R05220402 Set No. 3
II B.Tech Supplimentary Examinations, Aug/Sep 2008
OOP THROUGH JAVA
( Common to Electronics & Communication Engineering, Computer Science
& Engineering, Information Technology, Computer Science & Systems
Engineering, Electronics & Telematics and Electronics & Computer
Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆
⋆⋆⋆⋆⋆
1 of 1
Code No: R05220402 Set No. 4
II B.Tech Supplimentary Examinations, Aug/Sep 2008
OOP THROUGH JAVA
( Common to Electronics & Communication Engineering, Computer Science
& Engineering, Information Technology, Computer Science & Systems
Engineering, Electronics & Telematics and Electronics & Computer
Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆
3. Add a new method in the base class of Shapes.java that prints a message, but don’t
override it in the derived classes. Explain what happens. Now override it in one of
the derived classes but not the others, and Explain what happens. Finally, override
it in all the derived classes, Explain in detail about each situation. [16]
5. (a) Explain throws statement in Java with the help of an example program.
(b) What is the difference between throw and throws statement. [8+8]
6. Write a java program which displays a clock. The edges are static. Three edges
are required indicating hour, minute, and seconds. The length and width of edges
should be approximately chosen. Display “Timex” at the centre of the clock. [16]
8. Explain the following methods of StringBuffer class and write a java program illus-
trating these. Length(), capacity(), SetLength(), EnsureCapacity(). [4+4+4+4]
⋆⋆⋆⋆⋆
1 of 1