Object Oriented Programming I focuses on fundamental concepts of OOP, including inheritance, encapsulation, and polymorphism. This course material is tailored for students enrolled in the Gujarat Technological University, covering essential Java programming principles. Key topics include exception handling, file I/O, and multithreading, providing a comprehensive understanding for aspiring software developers. The document includes practical programming examples and exercises to reinforce learning outcomes.

Key Points

  • Explains core OOP principles such as inheritance, encapsulation, and polymorphism.
  • Covers exception handling in Java with practical try-catch examples.
  • Includes file I/O operations using byte and character streams.
  • Demonstrates multithreading concepts through the Thread class and Runnable interface.
Jeen Covey
2 pages
Language:English
Type:Study Guide
Jeen Covey
2 pages
Language:English
Type:Study Guide
424
/ 2
1
Seat No.: ________ Enrolment No.___________
GUJARAT TECHNOLOGICAL UNIVERSITY
BE - SEMESTERIV (NEW) EXAMINATION SUMMER 2022
Subject Code:3140705 Date:08-07-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)
List out features of Java. Explain any two features.
3
(b)
Write a single program which demonstrates the usage of following
keywords:
i) import, ii) new, iii) this, iv) break, v) continue
Show how to compile and run the program in java.
4
(c)
Demonstrate use of try-catch construct in case of hierarchical
Exception Handling. (i.e handling various exception belongs to the
exception hierarchy)
7
Q.2
(a)
Explain following Java keywords using appropriate examples:
i) static, ii) final, iii) super
3
(b)
Consider class A as the parent of class B. Explain among the
following which statement will show the compilation error.
i) A a = new A();
ii) A a = new B();
iii) B b = new A();
iv) B b = new B();
4
(c)
Write a java program to take infix expressions and convert it into
prefix expressions.
7
OR
(c)
Write a java program that evaluates a math expression given in string
form from command line arguments.
7
Q.3
(a)
Defines types of inheritance.
3
(b)
Explain the following constructors using appropriate example:
i) Default constructor and Parameterised constructor
ii) Shallow copy and Deep copy constructor
4
(c)
Explain file io using byte stream with appropriate example.
hint: use FileInputStream, FileOutputStream
7
OR
Q.3
(a)
Define types of polymorphism
3
(b)
Explain the following:
i) Arguments and Parameters of a function
ii) Pass by Value and Pass by reference
4
2
(c)
Explain file io using character stream with appropriate example.
hint: use FileReader, FileWriter
7
Q.4
(a)
Define Encapsulation and access specifier
3
(b)
Explain multithreading using Thread class
4
(c)
Write a short note on Java Collections.
7
OR
Q.4
(a)
Differentiate between Abstract class and Interfaces
3
(b)
Explain multithreading using Runnable interface
4
(c)
Write a program to add input elements in ArrayList collection class,
then sort the inserted elements in descending order and display the
sorted output.
hint: use Collections.reverseOrder()
7
Q.5
(a)
Explain following Java keywords using appropriate examples:
i) throw, ii) throws, iii) finally
3
(b)
In multi-threading using Thread class, explain with an example how
a start() method call invokes the run method of the class extending
Thread class.
4
(c)
Write a short note on JAVAFX controls.
7
OR
Q.5
(a)
Explain thread life cycle
3
(b)
In multi-threads using the Runnable interface, explain with an
example how a start() method calls the run() method of a class
implementing a runnable interface.
4
(c)
Develop a GUI based application using JAVAFX controls.
7
*************
/ 2
End of Document
424

FAQs

What are the main concepts covered in Object Oriented Programming I?
Object Oriented Programming I covers essential concepts such as classes, objects, inheritance, encapsulation, and polymorphism. These principles are foundational for understanding how to structure and manage code effectively in Java. The course emphasizes practical applications of these concepts through programming exercises and examples.
How does exception handling work in Java?
Exception handling in Java is managed through the use of try-catch blocks. When an exception occurs, the program flow is transferred to the catch block, allowing developers to handle errors gracefully. This mechanism is crucial for maintaining program stability and providing user-friendly error messages.
What is the significance of multithreading in Java?
Multithreading allows Java programs to perform multiple tasks simultaneously, improving efficiency and responsiveness. By using the Thread class and implementing the Runnable interface, developers can create applications that handle concurrent operations, such as user interactions and background processing, without freezing the user interface.
What file I/O operations are discussed in this course?
The course discusses file I/O operations using both byte streams and character streams. It covers classes like FileInputStream and FileOutputStream for byte streams, and FileReader and FileWriter for character streams. These operations are essential for reading from and writing to files, enabling data persistence in Java applications.
What programming exercises are included in Object Oriented Programming I?
Object Oriented Programming I includes various programming exercises that reinforce the concepts taught in the course. Students are tasked with creating Java programs that utilize OOP principles, handle exceptions, perform file I/O, and implement multithreading, providing hands-on experience in software development.