
1
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.
List out features of Java. Explain any two features.
Write a single program which demonstrates the usage of following
keywords:
i) import, ii) new, iii) this, iv) break, v) continue
Show how to compile and run the program in java.
Demonstrate use of try-catch construct in case of hierarchical
Exception Handling. (i.e handling various exception belongs to the
exception hierarchy)
Explain following Java keywords using appropriate examples:
i) static, ii) final, iii) super
Consider class A as the parent of class B. Explain among the
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();
Write a java program to take infix expressions and convert it into
prefix expressions.
Write a java program that evaluates a math expression given in string
form from command line arguments.
Defines types of inheritance.
Explain the following constructors using appropriate example:
i) Default constructor and Parameterised constructor
ii) Shallow copy and Deep copy constructor
Explain file io using byte stream with appropriate example.
hint: use FileInputStream, FileOutputStream
Define types of polymorphism
Explain the following:
i) Arguments and Parameters of a function
ii) Pass by Value and Pass by reference