Gujarat Technological UniversityWinter 2024 Examination

GTU 3140705 Object Oriented Programming -I (Java) Winter 2024 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)
Why public, static, void and arguments in following statement required →
public static void main(String args[])
3 Marks
(b)
List out different types of loops available in java with code snippet.
4 Marks
(c)

Describe Inheritance, Polymorphism and Data Encapsulation characteristics of OOP with example.

7 Marks

Question 2

14 MarksMedium
(a)
State three use of final keyword.
3 Marks
(b)
Describe java Access modifier.
4 Marks
(c)
Define concept of method overloading and method overriding with examples.
7 Marks
OR OPTION
(c)
What is Abstract class? Describe usage of Abstract class with one example.
7 Marks

Question 3

14 MarksMedium
(a)
Describe use of Super keyword.
3 Marks
(b)
Describe various methods and usage of Object class in java.
4 Marks
(c)

Create a class called Employee that includes three pieces of information as instance variables—a first name (typeString), a last name (typeString) and a monthly salary (double). Your class should have a constructor that initializes the three instance variables. Provide a set and a get method for each instance variable. If the monthly salary is not positive, set it to 0.0. Write a test application 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.

7 Marks
OR OPTION
(a)
Describe use of static keyword.
3 Marks
(b)
Define property of Dynamic method dispatch with example.
4 Marks
(c)

Create a class named Account with instance variables Ac_No,Name and Balance and methods display (), setdata (),deposit(). In display () method, display the instance variables value Ac_No,Name and Balance). And in setdata () method set the instance variable values (Ac_No,Name and Balance) and in deposit() method the amount that user wants to deposit that will be deposited.

7 Marks

Question 4

14 MarksMedium
(a)
Write a Java program to copy one array list into another.
3 Marks
(b)
Read two numbers from command line argument and print sum of them.
4 Marks
(c)
Describe steps to create a package with one example.
7 Marks
OR OPTION
(a)
Describe following keywords:
i)throw
ii)throws
3 Marks
(b)
Compare Abstract class and Interface
4 Marks
(c)

Create a method named Withdraw () in the main function performing exception handling. Example: Balance = 1000; Withdraw = 12000 Here, Balance

7 Marks

Question 5

14 MarksMedium
(a)
Describe following term : finally and finalize
3 Marks
(b)

Write a java program to read employee details from emp.txt file and print on screen.

4 Marks
(c)

Create customer class which extends thread class and contains two instance variables name, ProductName and static variable Product Quantity. For example if two customers are trying to buy the same product at once then follow synchronization of two customers extending thread class.

7 Marks
OR OPTION
(a)
Describe any one wrapper class with its method usage.
3 Marks
(b)

Write a java program to read students details from console and write that students details into emp.txt file.

4 Marks
(c)
Write a program to create GUI for Student registration form 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 2024, 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