0% found this document useful (0 votes)
42 views8 pages

Oop (Pyq)

The document is a compilation of Object-Oriented Programming (OOP) exam questions from Gujarat Technological University, categorized by syllabus chapters. It includes questions on various topics such as Java basics, methods, classes, inheritance, exception handling, and JavaFX. Each chapter contains specific questions along with their marks distribution, covering a range of concepts essential for understanding OOP in Java.

Uploaded by

walgarop
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views8 pages

Oop (Pyq)

The document is a compilation of Object-Oriented Programming (OOP) exam questions from Gujarat Technological University, categorized by syllabus chapters. It includes questions on various topics such as Java basics, methods, classes, inheritance, exception handling, and JavaFX. Each chapter contains specific questions along with their marks distribution, covering a range of concepts essential for understanding OOP in Java.

Uploaded by

walgarop
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Object Oriented Programming Exam Questions by Chapter

Below is a compilation of Object-Oriented Programming (OOP) questions from Gujarat Technological


University BE Semester-IV exams (Summer 2020, Winter 2020, Summer 2021, Winter 2021, Summer
2022, Winter 2022), categorized into the 12 syllabus chapters.

1. Introduction to Java and Elementary Programming (8.7%)

 Winter 2022, Q1(a), 3 marks: Discuss significance of byte code.

 Winter 2022, Q1(b), 4 marks: Explain Java garbage collection mechanism.

 Summer 2022, Q1(a), 3 marks: List out features of Java. Explain any two features.

 Summer 2022, Q1(b), 4 marks: 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.

 Winter 2021, Q1(a), 3 marks: What are syntax errors (compile errors), runtime errors, and
logic errors?

 Winter 2021, Q1(b), 4 marks: What is Type Casting? Explain widening and narrowing type
casting.

 Winter 2021, Q1(c), 7 marks: Explain Data Types in detail with example.

 Summer 2020, Q1(a), 3 marks: Explain JRE, JDK and JIT.

 Winter 2020, Q1(b), 4 marks: Explain type-conversion in java.

 Winter 2020, Q2(c), 7 marks: What are the data-types and operators available in Java?

2. Selections, Mathematical Functions, and Loops (8.7%)

 Winter 2020, Q2(a), 3 marks: Difference between Nested if and multi-way if statements.

 Summer 2022, Q1(b), 4 marks: 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. (Note: Includes break, continue, relevant to loops).

3. Methods and Arrays (13%)

 Winter 2021, Q2(b), 4 marks: Explain "Passing argument by values" with example.

 Summer 2022, Q2(c), 7 marks: Write a java program to take infix expressions and convert it
into prefix expressions.

 Summer 2022, Q2(c)(OR), 7 marks: Write a java program that evaluates a math expression
given in string form from command line arguments.

 Summer 2022, Q3(b)(OR), 4 marks: Explain the following: i) Arguments and Parameters of a
function, ii) Pass by Value and Pass by reference.

 Summer 2021, Q2(a), 3 marks: Explain about arrays, Type of arrays and arrays methods.

 Summer 2020, Q2(c), 7 marks: Write a program, which shows an example of function
overloading. Also, differentiate between function overloading and overriding.
 Winter 2020, Q5(c), 7 marks: Write a method for computing ( x^y ) doing repetitive
multiplication. ( x ) and ( y ) are of type integer and are to be given as command line
arguments. Raise and handle exception(s) for invalid values of ( x ) and ( y ).

4. Objects and Classes (8.7%)

 Winter 2022, Q2(a), 3 marks: Explain constructor with the help of an example.

 Winter 2022, Q2(c), 7 marks: Explain all access modifiers and their visibility as class
members.

 Winter 2022, Q3(c), 7 marks: Explain the words super, static, final and this with the help of
an example.

 Winter 2022, Q4(b), 4 marks: What is constructor? Explain constructor overloading.

 Summer 2022, Q2(a), 3 marks: Explain following Java keywords using appropriate examples:
i) static, ii) final, iii) super.

 Summer 2022, Q3(b), 4 marks: Explain the following constructors using appropriate example:
i) Default constructor and Parameterised constructor, ii) Shallow copy and Deep copy
constructor.

 Summer 2022, Q4(a), 3 marks: Define Encapsulation and access specifier.

 Winter 2021, Q3(b), 4 marks: Explain following keywords: (1) super, (2) this.

 Winter 2021, Q4(a), 3 marks: Explain visibility modifiers.

 Winter 2021, Q5(b), 4 marks: Explain Inner class with example.

 Summer 2021, Q1(c), 7 marks: Define constructor. How objects are constructed? Explain
constructor overloading with an example.

 Summer 2021, Q2(b), 4 marks: Write short notes on access specifiers and modifiers in java.

 Summer 2021, Q3(c), 7 marks: Explain the concept of inner classes and explain the types of
inner classes with an example program.

 Summer 2020, Q1(b), 4 marks: Explain static keyword with example.

 Summer 2020, Q2(b), 4 marks: Method main is a public static method. Justify.

 Winter 2020, Q1(c), 7 marks: Explain class and object with respect to java.

 Winter 2020, Q3(b), 4 marks: Explain following keywords: 1) Static, 2) Super.

 Winter 2020, Q3(a), 4 marks: Explain access modifiers with Example.

 Winter 2020, Q6(c), 7 marks: List and explain available type of constructors in java with
example.

 Winter 2020, Q8(b), 4 marks: How to access object via reference variable? Explain with
example.

 Winter 2021, Q5(b), 4 marks: Explain static variable and static method with example.

5. Object-Oriented Thinking (10.9%)


 Winter 2022, Q1(c), 7 marks: List OOP characteristics and describe inheritance with
examples.

 Winter 2022, Q3(a), 3 marks: What is the final class? Why they are used?

 Winter 2022, Q3(b), 4 marks: What is Inheritance? List out the different forms of Inheritance
and explain any one with example.

 Summer 2022, Q2(b), 4 marks: 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().

 Summer 2022, Q3(a), 3 marks: Defines types of inheritance.

 Summer 2022, Q3(a)(OR), 3 marks: Define types of polymorphism.

 Summer 2022, Q3(c), 7 marks: Explain Overloading and Overriding with example.

 Summer 2022, Q4(a)(OR), 3 marks: Differentiate between Abstract class and Interfaces.

 Summer 2021, Q1(b), 4 marks: What is the difference between the StringBuffer and
StringBuilder classes?

 Summer 2021, Q2(b), 4 marks: Explain about Encapsulation, Abstraction.

 Summer 2021, Q2(c), 7 marks: State the design hints for class and inheritance. Also discuss
the working and meaning of the "static" modifier with suitable examples.

 Summer 2021, Q2(c)(OR), 7 marks: Explain in detail how inheritance and polymorphism are
supported in java with necessary examples.

 Summer 2021, Q3(a), 3 marks: Explain about Final class, Fields, Methods.

 Summer 2021, Q3(a), 3 marks: Explain about different types of string methods.

 Summer 2021, Q4(a), 3 marks: What is Dynamic binding? Show with an example how
dynamic binding works.

 Summer 2020, Q1(c), 7 marks: Explain inheritance with its types and give suitable example.

 Summer 2020, Q2(a), 3 marks: Compare object-oriented programming with sequential


programming.

 Summer 2020, Q3(a), 3 marks: Write difference between String class and StringBuffer class.

 Summer 2020, Q3(b), 4 marks: Explain super keyword with example.

 Summer 2020, Q3(c), 7 marks: Describe abstract class called Shape, which has three
subclasses say Triangle, Rectangle, and Circle. Define one method area() in the abstract class
and override this area() in these three subclasses to calculate for specific object i.e. area() of
Triangle subclass should calculate area of triangle likewise for Rectangle and Circle.

 Summer 2020, Q3(a)(OR), 3 marks: How can we protect sub class to override the method of
super class? Explain with example.

 Summer 2020, Q3(c)(OR), 7 marks: What do you mean by run time polymorphism? Write a
program to demonstrate run time polymorphism.
 Winter 2020, Q1(a), 3 marks: What is the difference between oop and procedural oriented
language?

 Winter 2020, Q3(c), 7 marks: Differentiate between final, finally and finalize. What will
happen if we make class and method as final?

 Winter 2020, Q4(a), 3 marks: Explain abstract class with example.

 Winter 2020, Q4(b), 4 marks: Explain Primitive data type and wrapper class data types.

6. Exception Handling, I/O, Abstract Classes, and Interfaces (8.7%)

 Winter 2022, Q3(b), 4 marks: Write exception handling mechanisms in JAVA.

 Winter 2022, Q4(a), 3 marks: What is the keyword "throw" used for? What is the keyword
"throws" used for?

 Winter 2022, Q4(c), 7 marks: Discuss BufferedInputStream and BufferedOutputStream


classes with an example.

 Winter 2022, Q4(c), 7 marks: Create a class called Student. Write a student manager
program to manipulate the student information from files by using FileInputStream and
FileOutputStream.

 Summer 2022, Q1(c), 7 marks: Demonstrate use of try-catch construct in case of hierarchical
Exception Handling. (i.e handling various exception belongs to the exception hierarchy).

 Summer 2022, Q5(a), 3 marks: Explain following Java keywords using appropriate examples:
i) throw, ii) throws, iii) finally.

 Winter 2021, Q2(a), 3 marks: What is an interface? Explain with example.

 Winter 2021, Q2(c), 7 marks: Explain File class with its methods.

 Winter 2021, Q3(a), 3 marks: Differentiate String class and StringBuffer class.

 Winter 2021, Q3(c), 7 marks: Write a program that illustrates interface inheritance. Interface
P is extended by P1 and P2. Interface P12 inherits from both P1 and P2. Each interface
declares one constant and one method. class Q implements P12. Instantiate Q and invoke
each of its methods. Each method displays one of the constants.

 Winter 2021, Q4(c), 7 marks: What is an Exception? Explain try, catch and finally with
example.

 Summer 2021, Q3(b), 4 marks: What is a Package? What are the benefits of using packages?
Write down the steps in creating a package and using it in a java program with an example.

 Summer 2021, Q3(c), 7 marks: What is an Exception? Explain the exception hierarchy.
Explain how to throw, catch and handle Exceptions.

 Summer 2021, Q4(b), 4 marks: Write short notes about I/O stream classes.

 Summer 2020, Q3(b), 4 marks: Define Interface and explain how it differs from the class.

 Summer 2020, Q4(c), 7 marks: What is an Exception? List out various built-in exceptions in
JAVA and explain any one Exception class with suitable example.
 Winter 2020, Q4(c), 7 marks: Write a program to rise and handle divide by zero exception.

 Winter 2020, Q5(b), 4 marks: What is Exception? Demonstrate how you can handle different
types of exception separately.

 Winter 2020, Q7(c), 7 marks: Explain Comparable and Cloneable interface.

7. JavaFX Basics and Event-Driven Programming (10.9%)

 Winter 2022, Q4(a), 3 marks: List out various layout panes in JavaFX.

 Winter 2022, Q4(b), 4 marks: Explain the architecture of JavaFX.

 Winter 2022, Q4(b), 4 marks: Demonstrate animation effect in JavaFX.

 Summer 2022, Q4(c), 7 marks: Write a short note on Java Collections. (Note: Likely a typo in
exam paper; context suggests JavaFX controls intended).

 Summer 2021, Q4(a), 3 marks: Explain the concept of finalization.

 Summer 2021, Q4(b), 4 marks: What is reflection and how does it help to manipulate java
code.

 Summer 2020, Q5(a), 3 marks: Explain in brief: Color class and its methods.

 Summer 2020, Q5(c), 7 marks: Enlist various layout panes and explain any two in detail.

 Summer 2020, Q5(c)(OR), 7 marks: How do you create a Scene object? How do you set a
scene in a stage? Is it possible to create multiple scenes? Write a program to place a circle in
the scene and fill circle with red color.

 Winter 2020, Q5(a), 3 marks: Explain mouse and key event handler in JavaFX.

 Winter 2020, Q6(a), 3 marks: Explain following classes in JavaFX: 1) Color class, 2) font class,
3) Image and image view class.

8. JavaFX UI Controls and Multimedia (8.7%)

 Winter 2022, Q4(a), 3 marks: List out JavaFX UI controls and explain any one in detail.

 Summer 2022, Q5(c), 7 marks: Write a short note on JAVAFX controls.

 Summer 2022, Q5(c)(OR), 7 marks: Develop a GUI based application using JAVAFX controls.

 Winter 2021, Q4(b), 4 marks: Explain following controls: (1) Checkbox, (2) Radio Button, (3)
Textfield, (4) Label.

 Summer 2021, Q5(c), 7 marks: With a neat diagram explain the Model view controller design
pattern and list out the advantages and disadvantages of using it in designing an application.

 Winter 2020, Q5(b), 4 marks: Explain following controls: 1) text-Area, 2) scrollbar, 3)


checkbox, 4) combo-box.

9. Binary I/O, Recursion, and Generics (8.7%)

 Winter 2022, Q4(c), 7 marks: Create a class called Student. Write a student manager
program to manipulate the student information from files by using FileInputStream and
FileOutputStream.
 Summer 2022, Q3(c), 7 marks: Explain file io using byte stream with appropriate example.
hint: use FileInputStream, FileOutputStream.

 Summer 2022, Q3(c)(OR), 7 marks: Explain file io using character stream with appropriate
example. hint: use FileReader, FileWriter.

 Summer 2021, Q5(c), 7 marks: What is Generic programming and why is it needed? Explain
with example. List the limitations and restrictions of generic programming.

 Summer 2020, Q4(a), 3 marks: Differentiate between Text I/O and Binary I/O.

 Summer 2020, Q4(b), 4 marks: Write a JAVA program to read student.txt file and display the
content.

 Winter 2020, Q4(b), 4 marks: Explain usage of class FileInputStream and FileOutputStream
by giving an example.

 Winter 2020, Q7(a), 3 marks: Differentiate Text I/O and Binary I/O.

10. Lists, Stacks, Queues, and Priority Queues (8.7%)

 Winter 2022, Q5(a), 3 marks: What is Java Collection?

 Winter 2022, Q5(b), 4 marks: List out methods of Iterator and explain it.

 Winter 2022, Q5(a), 3 marks: What is Vector class?

 Summer 2022, Q4(c)(OR), 7 marks: 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().

 Summer 2020, Q4(b), 4 marks: Explain ArrayList class.

 Summer 2020, Q5(b), 4 marks: What method do you use to obtain an element in the
collection from an iterator? Explain with example.

 Winter 2020, Q8(a), 3 marks: What is Collection? Explain list, stack, queue classes.

11. Sets and Maps (4.3%)

 Winter 2022, Q5(c), 7 marks: Explain Set and Map in Java with example.

 Summer 2020, Q5(a), 3 marks: Compare Set and List interfaces.

 Winter 2021, Q5(a), 3 marks: Compare List and Set.

12. Concurrency (8.7%)

 Winter 2022, Q5(b), 4 marks: Describe with diagram the life cycle of Thread.

 Winter 2022, Q5(c), 7 marks: Explain synchronization in Thread with suitable example.

 Summer 2022, Q4(b), 4 marks: Explain multithreading using Thread class.

 Summer 2022, Q4(b)(OR), 4 marks: Explain multithreading using Runnable interface.

 Summer 2022, Q5(a), 3 marks: Explain thread life cycle.


 Summer 2022, Q5(b), 4 marks: 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.

 Summer 2022, Q5(b)(OR), 4 marks: 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.

 Summer 2021, Q4(c), 7 marks: Explain the thread state, thread properties and thread
synchronization.

 Summer 2020, Q4(c), 7 marks: Explain Thread life cycle in detail. Write a program to create a
child thread to print integer numbers 1 to 10.

 Winter 2020, Q8(c), 7 marks: What do you understand by thread? Describe the complete life
cycle of thread.

 Winter 2021, Q5(c), 7 marks: What is thread? Describe the complete life cycle of thread.

 Winter 2021, Q5(c)(OR), 7 marks: Explain Thread Synchronization with example.

Additional Topics (Not in Syllabus Chapters)

Some questions fall outside the 12 syllabus chapters but appear in the exams:

 Callback and Proxy: Summer 2021, Q5(a), 3 marks: Explain about callback; Q5(a)(OR), 3
marks: Explain about Proxy class, Interface and Methods.

 Adapter Classes and Mouse Events: Summer 2021, Q5(b), 4 marks: Explain about adapter
classes and mouse events with an example.

 Miscellaneous: Summer 2022, Q2(c), 7 marks: Write a java program to take infix expressions
and convert it into prefix expressions; Summer 2022, Q2(c)(OR), 7 marks: Write a java
program that evaluates a math expression given in string form from command line
arguments.

These topics are minor (1–2 questions) and may be supplementary or misaligned with the syllabus.
They are listed for completeness but not categorized into the main chapters.

Notes

 12 Chapters: Questions are organized into the 12 syllabus chapters, with weightages
reflecting credits (e.g., 13% for Methods and Arrays, 4.3% for Sets and Maps) and exam
question frequency/marks.

 Syllabus Alignment: The syllabus aligns well with exam questions, covering Java basics, OOP
principles, JavaFX, and advanced topics. Minor gaps (e.g., recursion, mathematical functions)
exist, possibly integrated into coding tasks.

 Completeness: All questions from the exam papers are included, with Winter 2020 having
partial coverage (4/8 questions, 56 marks) due to exam structure.

 Coding Emphasis: Exams prioritize coding (e.g., file I/O, polymorphism, JavaFX GUIs),
explanations (e.g., keywords, lifecycle), and examples (e.g., controls, exceptions), matching
the syllabus’s practical focus.
 Context: Your prior DM/COA queries and the provided syllabus guide the structure. The
focus is on exam-relevant content for May 15, 2025, with emphasis on coding and examples.

You might also like