Gujarat Technological UniversitySummer 2026 examination

GTU BE04000231 Object Oriented Programming Summer 2026 Question Paper & PDF

B.E. · Common Engineering · Semester 4 · Subject code BE04000231
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.

Q.1

14 Marks
(a)
3 marks
How one can compile and execute a Java program?
(b)
4 marks

Demonstrate the working of break, continue, labelled break, labelled continue with proper example.

(c)
7 marks

Write a Java program to simulate a simple ATM or cashier. Given an integer amount to be dispensed (e.g., 787), calculate and display the minimum number of currency notes of denominations 100, 50, 10, 5, 2, and 1 that would be given to the user.

Q.2

14 Marks
(a)
3 marks
Explain Java access specifiers with scope, visibility, and examples.
(b)
4 marks
Explain the different types of constructors in Java with appropriate examples.
(c)
7 marks

Write a Java program to design a class Time with hours (int) and minutes (int) as data members. Include method setTime(int h, int m) to initialize the time and displayTime() to display the time. Implement a method addTime(Time t1, Time t2) that adds t1 and t2, and print the result.

(c)
7 marks
Fill in the blanks to get following output.

Output: 3 5 8 13 21 public class FibonacciRecursive { public _____ void generateFibonacci(_____ first, int second, int n) { if (n == 0) return; System.out._______(first + " "); generateFibonacci(second, _____, _______); } public static ________ main(String[] args) { generateFibonacci(3, _____, 5); } }

Q.3

14 Marks
(a)
3 marks
Demonstrate all the uses of the final keyword in Java with suitable examples.
(b)
4 marks
Differentiate between StringBuffer and StringBuilder class.
(c)
7 marks
Explain the concept of method overloading with an example.
(a)
3 marks
Demonstrate all the uses of the super keyword in Java with suitable examples.
(b)
4 marks

What is the purpose of wrapper classes for primitive types in Java? Demonstrate autoboxing and unboxing with suitable example.

(c)
7 marks
Explain the concept of method overriding with an example.

Q.4

14 Marks
(a)
3 marks
What is the significance of throws keyword in Java?
(b)
4 marks
Demonstrate the use of a synchronized method in Java with a suitable example.
(c)
7 marks

Design a Java program for an Online Order Processing System using partial interface implementation. Create an interface Order with three methods: placeOrder(String item, int qty), cancelOrder(int orderId), generateBill(). Create an abstract class PartialOrder that implements the Order interface but provides implementation only for placeOrder() (storing order details). Create a concrete class FinalOrder that extends PartialOrder and implements the remaining methods cancelOrder() and generateBill(). Accept user input for order details and allow user to either generate a bill or cancel the order.

(a)
3 marks
List and explain any three methods of the Thread class in Java
(b)
4 marks

Write a Java program where Thread T1 prints 1 to 100, T2 prints 101 to 200 and T3 prints 201 to 300. Initiate all three threads simultaneously, but ensure that numbers are printed in sequence.

(c)
7 marks

Write a Java program to create a class VotingApp where the method checkEligibility(int age) checks if a person is eligible to vote. If age < 18, explicitly throw the predefined exception IllegalArgumentException with the message "Invalid Age". The finally block should always print "Validation done".

Q.5

14 Marks
(a)
3 marks
Give the output of the following code.

import java.util.*; public class Main { public static void main(String[] args) { List list = new ArrayList<>(); Set set = new HashSet<>(); list.add("C++"); list.add("Java"); list.add("C++"); set.add("C++"); set.add("Java"); set.add("C++"); System.out.print(list.size() * set.size()); } }

(b)
4 marks
Write a Java Program to copy the content of one file to other.
(c)
7 marks

Develop a JavaFX application for a basic login system. When the user clicks the login button, the application should validate the entered credentials against predefined values and generates appropriate response message.

(a)
3 marks
Explain LinkedList in Java with a suitable example.
(b)
4 marks
Write a program to display file properties like name, size, path, .
(c)
7 marks
List JavaFX layouts and demonstrate each with suitable examples.

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 (Summer 2026, B.E. · Common 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