Vous êtes sur la page 1sur 4

SET- 1

Code No: 2420207


IV B. Tech II Semester Regular Examinations, April/May 2009
OOPS THROUGH JAVA
( Electrical and Electronics 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 using
the following conversion formula C = (F - 32)/1.8 And display the values in a
tabular form. [8+8]
2. (a) What is class? How does it accomplish data hiding?
(b) How do classes help us to organize our programs?

co m
ld
(c) Compare and contrast overloading and overriding methods.
. [4+4+8]
3.

r
(a) What is Multiple Inheritance? Explain how it cam be implemented in Java with
the help of an example.

o
tu w
(b) Discuss the dynamic method dispatch mechanism with the help of an example.
[8+8]

example.
. n
4. What is package? Explain the procedure to create a package with the help of

j 16]

w
5.
w
(a) Give the list of dierent checked exceptions in java and their meaning.
(b) Explain in detail any three checked exceptions. [7+9]

w 6. (a) Explain the delegation event models?


(b) Explain the role of Event source and Event listeners with an Example.
7. Create an applet with two toolbars. One toolbar should be created using JButtons
[7+9]

and a separator and another toolbar should be created using 3 custom Action
classes. Add one to thenorth and another to thesouth 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]
8. What do you mean by URL? How to create an URL? Explain several methods
provided by URL? Give appropriate examples. [16]
SET- 2
Code No: 2420207
IV B. Tech II Semester Regular Examinations, April/May 2009
OOPS THROUGH JAVA
( Electrical and Electronics Engineering )
Time: 3 Hours Max. Marks 80

Answer any FIVE questions


All questions carry equal marks
********

1. (a) Java is freeform language. Comment


(b) What is an empty statement? Explain its usefulness.
(c) What are command line arguments? How are they useful? [4+6+6]
2. (a) What is meant by overloading methods? What are the advantages of overloading
concept?

co m
(b) Write a method find_Area that can find the area of the circle/square/rectangle
using overloading concept.

ld . [8+8]

o r
3. (a) Explain about final classes, final methods and final variables?
(b) Explain about the abstract class with example program? [8+8]

tu w
4. Prove that the fields in an interface are implicitly static and final. [16]
5. (a) Give the Class hierarchy in Java related to exception handling. Briefly explain
each class.

. j n
(b) What is the necessity of exception handling? Explain exception handling taking

w w
divide-by-zero as an example.
6. Explain in detail about the following event classes:
[6+10]

w (a) ComponentEvent
(b) ContainerEvent
(c) FrameEvent. [6+5+5]
7. (a) In what way JList dier from JComboBox?
(b) JList does not support scrolling. Why? How this can be remedied? Explain with
an example. [6+10]
8. (a) Discuss briefly about the following: TCP, UDP, URL
(b) What is InetAddress? How to create an InetAddress? What is its use? [8+8]
SET- 3
Code No: 2420207
IV B. Tech II Semester Regular Examinations, April/May 2009
OOPS THROUGH JAVA
( Electrical and Electronics Engineering )
Time: 3 Hours Max. Marks 80

Answer any FIVE questions


All questions carry equal marks
********

1. Explain various control structures and lexical issues in Java. [16]


2. (a) What is class? How does it accomplish data hiding?
(b) How do classes help us to organize our programs?
(c) Compare and contrast overloading and overriding methods. [4+4+8]

co m
3. (a) Is there any alternative solution for Inheritance. If so explain the advantages and
disadvantages of it.
(b) Explain about Object class in detail.

ld . [8+8]

o r
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

tu w
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.

. j n
(a) Explain throws statement in Java with the help of an example program.
(b) What is the dierence between throw and throws statement. [8+8]

6.

w w
Why do you use frames? Explain the syntax and functionality of dierent methods
related to Frames. [16]

w 7. Explain the steps involved in creating JCheckBox, JRadioButton, JButton, JLabel.


[4+4+4+4]
8. Define sockets. Use socket programming to design a client/server application that
takes the password as input and checks whether it is correct. The program should print
the appropriate message. [16]
SET- 4
Code No: 2420207
IV B. Tech II Semester Regular Examinations, April/May 2009
OOPS THROUGH JAVA
( Electrical and Electronics Engineering )
Time: 3 Hours Max. Marks 80

Answer any FIVE questions


All questions carry equal marks
********

1. (a) What are the drawbacks of structured procedural languages? Explain how Java
solved these problems.
(b) How is portability achieved in Java?
(c) Write any five applications of OOP technology. [5+5+6]

co m
2. (a) What is a constructor? What is the dierence between default constructor and

.
Parameterized constructor?

ld
(b) Explain the parameter passing mechanism in Java with an example. [8+8]
3.

r
Create an abstract class with no methods. Derive a class and add a method. Create a

o
static method that takes a reference to the base class, downcasts it to the derived class,

tu w
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.

. j n
4. (a) What is interface? Write a program to demonstrate how interfaces can be
[16]

w
extended.
w
(b) What is package? How do you create a package? Explain about the access

w protection in packages?
5. (a) What is the meaning of rethrowing an exception? When it is useful.
(b) What are the limitations of exception handling feature of java.
[8+8]

[8+8]
6. (a) Why creating a subclass of Frame is preferred over creating an instance of Frame
when creating a window.
(b) Explain the steps in creating a subclass of frame with the help of examples. [4+12]
7. Briefly explain the components of AWT. [16]
8. (a) What is a port? What is the dierence between port and socket?
(b) Explain several methods provided by URL? [8+8]

Vous aimerez peut-être aussi