Gujarat Technological UniversityWinter 2025 Examination

GTU 3140705 Object Oriented Programming -I (Java) Winter 2025 Paper Solution & PDF

B.E. · Computer Engineering · Semester 4 · Subject Code: 3140705
Download Official GTU PDF
Share:
Total Marks70 MarksExternal theory exam
Passing Marks23 Marks33% minimum cutoff
Exam Duration2.5 Hours2:30 PM – 5:00 PM
Paper Structure5 QuestionsWith internal OR choices
Jump toQ1Q2Q3Q4Q5

Question 1

14 MarksMedium
(a)
(
i)What happens when your program attempts to access an array element with an invalid index?
ii)What are the benefits of data field encapsulation?
iii)What is the registration method for a button to register an Action Event handler?
3 Marks
(b)
Differentiate following:
i)abstract class with interface
ii)String with String Buffer
4 Marks
(c)

Write a method that returns a new array by eliminating the duplicate values in the array using the following method header: public static int[] eliminate Duplicates(int[] list). Write a test program that reads in ten integers, invokes the method, and displays the result.

7 Marks

Question 2

14 MarksMedium
(a)
Compare static methods with instance methods.
3 Marks
(b)

How do you create a button with a text and a node? How do you set a handler for processing a button-clicked action?

4 Marks
(c)

What is exception? Explain the use of exception handling keywords with example.

7 Marks
OR OPTION
(c)
How do interfaces support polymorphism? Explain with example.
7 Marks

Question 3

14 MarksMedium
(a)
What is polymorphism? What is dynamic binding?
3 Marks
(b)
Explain the use of File class to handle I/O.
4 Marks
(c)

Write the bin2Dec(String binary String) method to convert a binary string into a decimal number. Implement the bin2Dec method to throw a Number Format Exception if the string is not a binary string.

7 Marks
OR OPTION
(a)

How do you prevent a class from being extended? How do you prevent a method from being overridden?

3 Marks
(b)
Differentiate the followings:
i)Checked and Unchecked Exceptions
ii)Text I/O and Binary I/O
4 Marks
(c)

Write a program that lets users copy files. The user needs to provide a source file and a target file as command-line arguments using the command: java Copy source target

7 Marks

Question 4

14 MarksMedium
(a)

Define the compare To method in a class implementing the Comparable interface. What are the benefits of implementing the Comparable interface?

3 Marks
(b)
What do you understand by thread? Describe the complete life cycle of thread.
4 Marks
(c)
Describe and compare Hash Map, Linked Hash Map, and Tree Map.
7 Marks
OR OPTION
(a)

What is a recursive method? Write a recursive mathematical definition for computing 2n for a positive integer n.

3 Marks
(b)

What do you mean by thread synchronization? How can you synchronize java threads?

4 Marks
(c)

Write a program to add ten elements in a list and traverse a list in both directions.

7 Marks

Question 5

14 MarksMedium
(a)

What are the benefits of using generic types? How do you declare a generic type in a class?

3 Marks
(b)

Which method do you use to obtain an element in the collection from an iterator? Explain with example.

4 Marks
(c)

Which layout panes are supported by JavaFX? Write a program to create a login screen using Grid Pane.

7 Marks
OR OPTION
(a)
How do you declare and invoke a generic method?
3 Marks
(b)
How do create and use anonymous inner class?
4 Marks
(c)

Write a program to define and register handlers for key pressed, key released, and key typed events using JavaFX.

7 Marks
College Exam Groups

Studying for Object Oriented Programming -I?

Circulate this solved paper with KaTeX formulas and 1-click AI step solvers to your batchmates on WhatsApp or Telegram.

About this Examination Paper & Attribution

Official Gujarat Technological University (GTU) examination paper and step-by-step solutions for Object Oriented Programming -I (Java) (Winter 2025, 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.

Download PDF