PDF Google Drive Downloader v1.1


Báo lỗi sự cố

Nội dung text 3140705 - OOP 2023S.pdf

1 Seat No.: ________ Enrolment No.___________ GUJARAT TECHNOLOGICAL UNIVERSITY BE - SEMESTER– IV(NEW) EXAMINATION – SUMMER 2023 Subject Code:3140705 Date:25-07-2023 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) What is the Java bytecode, and what is the extension of Java bytecode file? Which software is needed to run Java bytecode? 03 (b) Describe syntax errors (compile errors), runtime errors, and logic errors by giving suitable examples? 04 (c) Answer in brief (within 50 words): I. Justify Java enables high performance. II. Differentiate between while and do while loop? III. How many times is the println statement executed? for (int i = 0; i < 10; i++) for (int j = 0; j < i; j++) System.out.println(i * j); IV. If the value of variable x is 1 then what will be returned by the following expression: x % 2 = = 0 07 Q.2 (a) What is the use of this keyword? How it is different from super keyword? 03 (b) (i) Given that Thing is a class, how many objects and how many reference variables are created by the following code? Thing item, stuff; item = new Thing(); Thing entity = new Thing(); (ii) Examine following code. Write and justify output. public class MyClass { public static void main(String[] args) { C c = new C(); System.out.println(c.max(12, 29)); } } class A { int max(int x, int y) { if (x>y) return x; else return y; } } class B extends A{ int max(int x, int y) { return super.max(y, x) - 10; } } class C extends B { int max(int x, int y) { return super.max(x+10, y+2); } } 04 (c) Write a program that defines class named StopWatch. The class contains: • Private data fields startTime and endTime with getter methods. 07

Tài liệu liên quan

x
Báo cáo lỗi download
Nội dung báo cáo



Chất lượng file Download bị lỗi:
Họ tên:
Email:
Bình luận
Trong quá trình tải gặp lỗi, sự cố,.. hoặc có thắc mắc gì vui lòng để lại bình luận dưới đây. Xin cảm ơn.