Content text 3140705 - OOP 2020S.pdf
1 Seat No.: ________ Enrolment No.___________ GUJARAT TECHNOLOGICAL UNIVERSITY BE - SEMESTER– IV EXAMINATION – SUMMER 2020 Subject Code: 3140705 Date:26/10/2020 Subject Name: Object Oriented Programming -I Time: 10:30 AM TO 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. MARKS Q.1 (a) Explain JRE, JDK and JIT. 03 (b) Explain static keyword with example. 04 (c) Explain inheritance with its types and give suitable example. 07 Q.2 (a) Compare object-oriented programming with sequential programming. 03 (b) Method main is a public static method. Justify 04 (c) Write a program, which shows an example of function overloading. Also, differentiate between function overloading and overriding. 07 OR (c) Write a program to take string input as command line argument. In addition, count occurrence of each character in a given string. 07 Q.3 (a) Write difference between String class and StringBuffer class. 03 (b) Explain super keyword with example. 04 (c) Describe abstract class called Shape, which has three subclasses say Triangle, Rectangle, and 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 likewise for Rectangle and Circle. 07 OR Q.3 (a) How can we protect sub class to override the method of super class? Explain with example. 03 (b) Define Interface and explain how it differs from the class. 04 (c) What do you mean by run time polymorphism? Write a program to demonstrate run time polymorphism. 07 Q.4 (a) Differentiate between Text I/O and Binary I/O. 03 (b) Explain ArrayList class. 04 (c) What is an Exception? List out various built-in exceptions in JAVA and explain any one Exception class with suitable example. 07 OR Q.4 (a) How do you declare a generic type in a class? Explain. 03 (b) Write a JAVA program to read student.txt file and display the content. 04 (c) Explain Thread life cycle in detail. Write a program to create a child thread to print integer numbers 1 to 10. 07 Q.5 (a) Explain in brief: Color class and its methods. 03 (b) What method do you use to obtain an element in the collection from an iterator? Explain with example. 04 (c) Enlist various layout panes and explain any two in detail. 07 OR Q.5 (a) Compare Set and List interfaces. 03 (b) Write importance of JAVAFX compare to AWT and Swing. 04 (c) How do you create a Scene object? How do you set a scene in a stage? Is it possible to create multiple scenes? Write a program to place a circle in the scene and fill circle with red color. 07