Seat No.: ________ Enrolment No.
___________
GUJARAT TECHNOLOGICAL UNIVERSITY
BE - SEMESTER–V • EXAMINATION – WINTER • 2014
Subject Code: 150704 Date: 01-12-2014
Subject Name: Object Oriented Programming with Java
Time: 10.30 am - 01.00 pm Total Marks: 70
Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.
Q.1 (a) Describe the following features of java: 07
1)Multithreaded,2)Architecture-neutral 3)Interpreted 4)High performance
5) Distributed 6) Portable 7) Dynamic
(b) Differentiate between Method overloading and method overriding with 07
example.
Q.2 (a) Explain the followings with example 07
Dynamic Method Dispatch , this, super, final
(b) Write a program to demonstrate the multipath inheritance for the classes 07
having relations as shown in figure 1.
Figure 1
OR
(b) Write a program that illustrates interface inheritance. Interface A is extended 07
by A1 and A2. Interface A12 inherits from both P1 and P2.Each interface
declares one constant and one method. Class B implements A12.Instantiate B
and invoke each of its methods. Each method displays one of the constants
Q.3 (a) What are the benefits of using generic types? 03
(b) Differentiate between abstract class and interface. 04
(c) Discuss public, private, protected and default access modifier with example. 07
OR
Q.3 (a) What is collection in Java? Differentiate between Vector and Array List. 07
(b) Justify statement. 07
(i) JVM is platform dependent.
(ii) There is no destructor in Java.
1
Q.4 (a) Write a simple GUI application that traces the user’s action such 07
Keyboard action.
(b) Write a program to replace all “word1” by “word2” from a file1, and output is 07
written to file2 file and display the no. of replacement.
OR
Q.4 (a) Create an applet which has a Text Field to accept a URL string, and displays 07
the document of the URL string in a new browser window.
(b) Differentiate String class and StringBuffer class with explanation of its 07
methods.
Q.5 (a) Write a program to create two threads, one thread will print odd numbers and 07
second thread will print even numbers between 1 to 20 numbers.
(b) Write a program that counts number of characters, words, and lines in a file. 07
Use exceptions to check whether the file that is read exists or not.
OR
Q.5 (a) Explain the following terms with respect to exception handling. 07
i) try ii) catch iii) throw iv) finally
(b) What is a thread? Describe the complete life cycle of thread with example. 07
*************