Anda di halaman 1dari 4

Code No: R05312203 Set No.

1
III B.Tech I Semester Regular Examinations, November 2007
OOP THROUGH JAVA
(Instrumentation & Control Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆

1. (a) How is java more secured than other languages?


(b) What is multithreading? How does it improve the performance of java?
(c) Write a program to find factorial of a given number. [4+4+8]

2. (a) What is a constructor? What are its special properties?


(b) How do we invoke a constructor?
(c) What are objects? How are they created from a class? [6+4+6]

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]

4. What is Multiple Inheritance? Explain how it cam be implemented in Java with


the help of an example. [16]

5. (a) When do you use Nested try statements. Explain nested try statements with
the help of an example java program.
(b) Explain nested try statements in the context of method calls with the help of
an example java program. [8+8]

6. (a) Write a java program which draws a dashed line and dotted line using applet.
(b) Write a java program to draw a polygon of eight edges. [10+6]

7. What are various JFC containers? List them according to their functionality. Ex-
plain each of them with examples. [16]

8. Briefly explain various functions of Math class. [16]

⋆⋆⋆⋆⋆

1 of 1
Code No: R05312203 Set No. 2
III B.Tech I Semester Regular Examinations, November 2007
OOP THROUGH JAVA
(Instrumentation & Control Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆

1. (a) List at least ten major differences between C and Java


(b) Compare in terms of their functions, the following pairs of statements:
i. while and do?.while
ii. while and for
(c) What is an empty statement? Explain its usefulness. [4+4+4+4]

2. (a) What is a constructor? What are its special properties?


(b) How do we invoke a constructor?
(c) What are objects? How are they created from a class? [6+4+6]

3. (a) Explain about final classes,final methods and final variables?


(b) Explain about the abstract class with example program? [8+8]

4. Create an interface with at least one method, in its own package. Create a class in
a separate package. Add a protected inner class that implements the interface. In
a third package, inherit from your class and, inside a method, return an object of
the protected inner class, upcasting to the interface during the return. [16]

5. (a) What is multithreading? What are its advantages?


(b) compare process based and thread based multitasking. [6+10]

6. What is Event listener? Explain the different Event Listener interfaces supported
by java and their purpose. [16]

7. (a) Explain the application services that can be used in JFC components.
(b) What is double buffering? What purpose does it serve? Explain with a java
skeleton code. 8+8]

8. (a) How does Random class generate pseudo random numbers?


(b) Write a program to generate a set of random numbers. Find its sum and
average. The program should also display * based on the random numbers
generated. [8+8]

⋆⋆⋆⋆⋆

1 of 1
Code No: R05312203 Set No. 3
III B.Tech I Semester Regular Examinations, November 2007
OOP THROUGH JAVA
(Instrumentation & Control 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) When do we declare a method or class final?


(b) When do we declare a method or class abstract?
(c) Describe different levels of access protections available in java. [4+4+8]

3. (a) Explain about final classes,final methods and final variables?


(b) Explain about the abstract class with example program? [8+8]

4. Write an interface called shape with necessary methods.Derive classes circle, rec-
tangle, triangle, cone, sphere and cube with appropriate constructors and methods
for area, volume also setting & displaying. [16]

5. (a) In Java, why finally keyword is necessary in exception handling.


(b) Explain finally block in exception handling with the help of an example.[4+12]

6. Explain in detail about the following event classes:

(a) ComponentEvent
(b) ContainerEvent
(c) FocusEvent. [6+5+5]

7. (a) Write briefly applet display methods.


(b) Write a java program to form a calculator. [8+8]

8. Explain connection less client/server interaction with datagrams in detail. Give


suitable example. [16]

⋆⋆⋆⋆⋆

1 of 1
Code No: R05312203 Set No. 4
III B.Tech I Semester Regular Examinations, November 2007
OOP THROUGH JAVA
(Instrumentation & Control Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆

1. Write a program that will compute the following series:


(a) 1/1 + 1/2 + 1/3 + ...... + 1/n
2
(b) 1/1 + 1/2 + 1/2 + ....... + 1/2n . [8+8]
2. (a) How does String class differ from the StringBuffer class?
(b) Write program to do the following: [6+10]
i. To output the question “who is the inventor of java”?
ii. To accept an answer
iii. To print out “Good” and then stop, if the answer is correct.
iv. To output the message “try again”, if the answer is wrong
v. To display the correct answer when the answer is wrong even at the third
attempt.
3. (a) What are the differences between private, final and static variables?
(b) Explain about Dynamic Method Dispatch. [8+8]
4. Write a program to create an interface containing a static inner class. Implement
this interface and create an instance of the inner class. [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]
6. Give class hierarchy related to Panel and Frame. Briefly explain all the classes.
[16]
7. Explain with examples. What happens when the following are clicked or released?
(a) JMenuItem
(b) JCheckBoxMenuItem
(c) JRadioButtonMenuItem. [5+5+6]
8. (a) What is the difference between Internet address and InetAddress?
(b) Explain datagrams. [8+8]

⋆⋆⋆⋆⋆

1 of 1

Anda mungkin juga menyukai