Object Oriented Programming I focuses on core concepts of OOP, including inheritance, polymorphism, and encapsulation. This examination from Gujarat Technological University assesses students' understanding of Java programming, garbage collection, and exception handling mechanisms. It includes various questions on constructors, access modifiers, and JavaFX architecture. Ideal for students preparing for their OOP exams, this document provides a comprehensive overview of essential programming principles and practices.

Key Points

  • Covers key OOP concepts such as inheritance, polymorphism, and encapsulation.
  • Includes questions on Java garbage collection and exception handling mechanisms.
  • Explains the significance of constructors and access modifiers in Java.
  • Discusses JavaFX architecture and various layout panes for UI design.
Jeen Covey
1 page
Language:English
Type:Past Paper
Jeen Covey
1 page
Language:English
Type:Past Paper
419
/ 1
1
Seat No.: ________ Enrolment No.___________
GUJARAT TECHNOLOGICAL UNIVERSITY
BE - SEMESTERIV(NEW) EXAMINATION WINTER 2022
Subject Code:3140705 Date:20-12-2022
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)
Discuss significance of byte code.
03
(b)
Explain Java garbage collection mechanism.
04
(c)
List OOP characteristics and describe inheritance with examples.
07
Q.2
(a)
Explain constructor with the help of an example.
03
(b)
List out different methods available for String class in java and explain
any two with proper example.
04
(c)
Explain all access modifiers and their visibility as class members.
07
OR
(c)
Compare String with StringBuffer. Also, write a program to count the
occurrence of a character in a string.
07
Q.3
(a)
What is the final class? Why they are used?
03
(b)
Write exception handling mechanisms in JAVA.
04
(c)
Explain Overloading and Overriding with example.
07
OR
Q.3
(a)
How can you create packages in Java?
03
(b)
What is Inheritance? List out the different forms of Inheritance and
explain any one with example.
04
(c)
Explain the words super, static, final and this with the help of an
example.
07
Q.4
(a)
List out various layout panes in JavaFX.
03
(b)
Explain the architecture of JavaFX.
04
(c)
Discuss BufferedInputStream and BufferedOutputStream classes with
an example.
07
OR
Q.4
(a)
List out JavaFX UI controls and explain any one in detail.
03
(b)
Demonstrate animation effect in JavaFX.
04
(c)
Create a class called Student. Write a student manager program to
manipulate the student information from files by using FileInputStream
and FileOutputStream.
07
Q.5
(a)
What is Java Collection?
03
(b)
List out methods of Iterator and explain it.
04
(c)
Explain Set and Map in Java with example.
07
OR
Q.5
(a)
What is Vector class?
03
(b)
Describe with diagram the life cycle of Thread.
04
(c)
Explain synchronization in Thread with suitable example.
07
***********
/ 1
End of Document
419

FAQs

What are the main characteristics of Object Oriented Programming?
Object Oriented Programming (OOP) is characterized by four main principles: encapsulation, inheritance, polymorphism, and abstraction. Encapsulation involves bundling data and methods that operate on that data within a single unit or class. Inheritance allows one class to inherit the properties and methods of another, promoting code reusability. Polymorphism enables methods to perform differently based on the object that invokes them, while abstraction simplifies complex systems by exposing only the necessary parts. Together, these principles enhance software design and maintainability.
How does Java handle garbage collection?
Java's garbage collection mechanism automatically manages memory by identifying and disposing of objects that are no longer in use. This process helps prevent memory leaks and optimizes resource allocation. The Java Virtual Machine (JVM) performs garbage collection in several ways, including mark-and-sweep, generational collection, and reference counting. Developers can also influence garbage collection behavior through various JVM options, but generally, it operates in the background, allowing programmers to focus on application logic rather than memory management.
What is the difference between overloading and overriding in Java?
Overloading and overriding are two key concepts in Java that enhance method functionality. Overloading occurs when multiple methods in the same class have the same name but different parameters, allowing for different implementations based on input types or numbers. In contrast, overriding happens when a subclass provides a specific implementation of a method that is already defined in its superclass. This allows subclasses to modify or extend the behavior of inherited methods, promoting dynamic method dispatch and runtime polymorphism.
What are the different access modifiers in Java?
Java provides four main access modifiers: public, private, protected, and default (package-private). The 'public' modifier allows access from any other class, while 'private' restricts access to the defining class only. The 'protected' modifier permits access to subclasses and classes in the same package. The default modifier, which is applied when no modifier is specified, allows access only within classes in the same package. Understanding these modifiers is crucial for controlling visibility and encapsulation in Java applications.