GTU previous years question papers -BE- Sem-Vth -Object oriented programming with Java -MAY/JUNE -2012

GTU previous years question papers

GUJARAT TECHNOLOGICAL UNIVERSITY

BE- Vth SEMESTER–EXAMINATION – MAY/JUNE – 2012

Subject code: 15   04

Subject Name: Object oriented programming with Java

 

Instructions:

1. Attempt all questions.

2. Make suitable assumptions wherever necessary.

3. Figures to the right indicate full marks.

Q.1 (a) Explain features of JAVA.    

(b) Explain interface in JAVA. How do interfaces support polymorphism?    

Q.2 (a) Explain Exception handling in JAVA. Write an application that generates custom exception if any value from its command line arguments is negative.

  (b) Why synchronization is required in multithreaded programming and how can we implement it in program?

OR

(b) Explain Thread Life Cycle in detail. Write a code to create Thread in JAVA.    

Q.3 (a) Write a program using BufferedInputStream, FileInputStream, BufferedOutputStream,

FileOutputStream to copy Content of one file File1.txt into another file File2.txt.  

(b) Describe abstract class called Shape which has three subclasses say

Triangle,Rectangle,Circle. Define one method area() in the abstract class and override this area() in these three subclasses to calculate for specific object i.e. area() of Triangle subclass should calculate area of triangle etc. Same for Rectangle and Circle

OR

Q.3 (a) Write a program to display the bytes of a file in reverse sequence. Provide the name of the file as a command line argument. (Use RandomAccessFile  

(b) Write a program that illustrates interface inheritance. Interface P is extended by P1

and P2. Interface P12 inherits from both P1 and P2.Each interface declares one

constant and one method. class Q implements P12.Instantiate Q and invoke each of its methods. Each method displays one of the constants

Q.4 (a) Differentiate Applet and Application.    

(b) Differentiate String class and StringBuffer class with explanation of its methods.

OR

Q.4 (a) Write an applet that contains three buttons OK,CANCEL and HELP and one

textfield. if OK is pressed shown on the status bar-“OK is pressed” and the text

field should turn red. When CANCEL is pressed -shown on the status bar-“

CANCEL is pressed “and text field should turn green. When HELP is pressedshown on the status bar-“HELP is pressed” and the text field should turn yellow.

(b) Explain Applet life cycle with demo program.    

Q.5 (a) Explain package in java. List out all packages with short description.    

(b) Differentiate Method Overloading and Method Overriding with example.    

OR

Q.5 (a) Explain Event Handling in java and describe methods of mouse event and key event.

  (b) Explain Generics in java with demo program.    

 

To download engineering ebooks, medical ebooks, management ebooks, free ebooks please visit www.kopykitab.com

Leave a Comment