Gujarat Technological UniversitySummer 2023 examination

GTU 3140705 Object Oriented Programming -I (Java) Summer 2023 Question Paper & PDF

B.E. · Computer Engineering · Semester 4 · Subject code 3140705
Download official PDFView PDF here
Share with your class
Total
70 marks
To pass
23 marks (33%)
Duration
2.5 Hours 10:30 AM – 1:00 PM
Questions
5 with internal choice
No solutions on this paper yetNeed them for your exam? Ask once. Papers that students ask for are solved first, and we aim to add them within 24 hours.

8 of 25 questions on this paper were also asked in other years. 1 more is a type of question GTU sets again with new data. Each is marked below with the years it appeared.See all 25 repeated 3140705 questions, most asked first

Q.1

14 Marks
(a)
3 marks

What is the Java bytecode, and what is the extension of Java bytecode file? Which software is needed to run Java bytecode?

(b)
4 marks

Describe syntax errors (compile errors), runtime errors, and logic errors by giving suitable examples?

(c)
7 marks
Answer in brief (within 50 words):
IJustify Java enables high performance.
IIDifferentiate between while and do while loop?
IIIHow 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);
IVIf the value of variable x is 1 then what will be returned by the

following expression: x % 2 = = 0

Q.2

14 Marks
(a)
3 marks
What is the use of this keyword? How it is different from super keyword?
(b)
4 marks
(
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); } }
(c)
7 marks
Write a program that defines class named StopWatch. The class contains:
  • Private data fields startTime and endTime with getter methods. 07 • no-arg constructor that initializes startTime with the current time.
  • A method named start() that resets the startTime to the current time.
  • A method named stop() that sets the endTime to the current time.
  • A method named getElapsedTime() that returns the elapsed time for the stopwatch in milliseconds.
  • Declare object of StopWatch to demonstrate stop watch. Hint: Use System.currentTimeMillis() to get current time in milliseconds.
(c)
7 marksSame type asked in 2 of 7 papers
Create a class called Employee that includes:
IThree instance variables— id (type String), name (type String) and monthly_salary (double).
IIA default constructor that initializes the three instance variables.
IIIA setter and a getter method for each instance variable (for example for id variable void setId(String id), String getId( )).
IVdisplayEmployee() method for displaying employee details. Write a driver class named EmployeeTest that demonstrates class Employee’s capabilities. Create two Employee objects and display each object’s yearly salary. Then give each Employee a 10% raise and display each Employee’s yearly salary again.

Also asked in Winter 2024 Q3c

Q.3

14 Marks
(a)
3 marksAsked in 2 of 7 papers
Differentiate between checked and unchecked exception?

Also asked in Winter 2023 Q3b OR

(b)
4 marksAsked in 5 of 7 papers
Exemplify throw and throws clause of exception handling?

Also asked in Summer 2026 Q4b OR, Summer 2025 Q4a OR, Winter 2024 Q4a OR, Summer 2024 Q4a

(c)
7 marks

Demonstrate use of try catch block by catching ArithmeticExceptions and InputMismatchExceptions?

(a)
3 marksAsked in 5 of 7 papers
Describe thread life cycle with block diagram?

Also asked in Summer 2026 Q5c, Winter 2025 Q4b, Summer 2025 Q5b, Summer 2024 Q5a OR

(b)
4 marksAsked in 3 of 7 papers

Differentiate between Thread class and Runnable interface for implementing Threads?

Also asked in Summer 2026 Q5c OR, Winter 2023 Q3c

(c)
7 marks

Write a program to make calculator that accepts input from commandline? Use java’s exception handling mechanism to handle abnormal situation?

Q.4

14 Marks
(a)
3 marks
Define Queue interface of java collection classes?
(b)
4 marksAsked in 2 of 7 papers
Explain types of polymorphism?

Also asked in Summer 2025 Q3c OR

(c)
7 marks

What are the differences between ArrayList and LinkedList? Demonstrates use of ArrayList with example?

(a)
3 marks
Define Object Serialization?
(b)
4 marks
What are the differences between text I/O and binary I/O?
(c)
7 marksAsked in 3 of 7 papers
Describe and demonstrate Binary I/O classes of java?

Also asked in Summer 2026 Q4c OR, Winter 2023 Q5a

Q.5

14 Marks
(a)
3 marks
Answer in one line:
i)Write the name of package in which all collection classes and interface are grouped.
ii)Write the name of collection interface or abstract class which store and process object in a first-in, first-out fashion.
iii)Write the name of method that checks whether the collection contains the specified element.
(b)
4 marksAsked in 2 of 7 papers
List JavaFX UI controls?

Also asked in Summer 2026 Q4b

(c)
7 marksAsked in 2 of 7 papers

What do you understand by event source and event object? Explain how to register an event handler object and how to implement a handler interface?

Also asked in Summer 2026 Q4a OR

(a)
3 marks
Enlist various Layout panes available in JavaFX?
(b)
4 marks
Discuss JavaFX benefits?
(c)
7 marks
Illustrate basic structure of JavaFX program?

More Object Oriented Programming -I papers

Questions repeat across sessions. Working through two or three papers shows you which topics GTU asks most.

Preparing with friends?

Send this paper to your class group. Every question has its own link.

About this paper

Official Gujarat Technological University (GTU) examination paper for Object Oriented Programming -I (Java) (Summer 2023, B.E. · Computer Engineering, Sem 4). Features complete 70-mark regular & remedial examination pattern, official marking distribution across all 5 questions, and direct 1-click official PDF download.

Transcribed for student exam preparation from Gujarat Technological University official examination archives. Questions, syllabus guidelines, and curriculum marking schemes remain the intellectual property of Gujarat Technological University.

ViewDownload PDF