The document is an exam paper for an Object Oriented Programming course. It contains 5 questions testing knowledge of Java features like inheritance, polymorphism, exceptions and file I/O. It also tests multi-threading concepts and use of collections and JavaFX controls.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
44 views2 pages
Oop S22
The document is an exam paper for an Object Oriented Programming course. It contains 5 questions testing knowledge of Java features like inheritance, polymorphism, exceptions and file I/O. It also tests multi-threading concepts and use of collections and JavaFX controls.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2
Seat No.: ________ Enrolment No.
___________
GUJARAT TECHNOLOGICAL UNIVERSITY
BE - SEMESTER–IV (NEW) EXAMINATION – SUMMER 2022 Subject Code:3140705 Date:08-07-2022 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. 4. Simple and non-programmable scientific calculators are allowed. Marks Q.1 (a) List out features of Java. Explain any two features. 3 (b) Write a single program which demonstrates the usage of following 4 keywords: i) import, ii) new, iii) this, iv) break, v) continue Show how to compile and run the program in java. (c) Demonstrate use of try-catch construct in case of hierarchical 7 Exception Handling. (i.e handling various exception belongs to the exception hierarchy)
Q.2 (a) Explain following Java keywords using appropriate examples: 3
i) static, ii) final, iii) super (b) Consider class A as the parent of class B. Explain among the 4 following which statement will show the compilation error. i) A a = new A(); ii) A a = new B(); iii) B b = new A(); iv) B b = new B(); (c) Write a java program to take infix expressions and convert it into 7 prefix expressions. OR (c) Write a java program that evaluates a math expression given in string 7 form from command line arguments.
Q.3 (a) Defines types of inheritance. 3
(b) Explain the following constructors using appropriate example: 4 i) Default constructor and Parameterised constructor ii) Shallow copy and Deep copy constructor (c) Explain file io using byte stream with appropriate example. 7 hint: use FileInputStream, FileOutputStream OR Q.3 (a) Define types of polymorphism 3 (b) Explain the following: 4 i) Arguments and Parameters of a function ii) Pass by Value and Pass by reference 1 (c) Explain file io using character stream with appropriate example. 7 hint: use FileReader, FileWriter
Q.4 (a) Define Encapsulation and access specifier 3
(b) Explain multithreading using Thread class 4 (c) Write a short note on Java Collections. 7 OR Q.4 (a) Differentiate between Abstract class and Interfaces 3 (b) Explain multithreading using Runnable interface 4 (c) Write a program to add input elements in ArrayList collection class, 7 then sort the inserted elements in descending order and display the sorted output. hint: use Collections.reverseOrder()
Q.5 (a) Explain following Java keywords using appropriate examples: 3
i) throw, ii) throws, iii) finally (b) In multi-threading using Thread class, explain with an example how 4 a start() method call invokes the run method of the class extending Thread class. (c) Write a short note on JAVAFX controls. 7 OR Q.5 (a) Explain thread life cycle 3 (b) In multi-threads using the Runnable interface, explain with an 4 example how a start() method calls the run() method of a class implementing a runnable interface. (c) Develop a GUI based application using JAVAFX controls. 7