Retrieving academic index assets...
Makaut
HomePYQsTests
Pricing
Sign Up
Makaut

The premier academic archive for MAKAUT students, providing curated previous year questions, solutions, and official syllabus resources.

Get the Mobile App
GET IT ONGoogle Play
Download on theApp Store
Download from Indus App Store
Platform
  • Home
  • PYQs
  • Question Papers
  • Viva Questions
  • Important Questions
  • Syllabus
  • Academic Tools
  • Pricing
  • Blog
Guidelines
  • Disclaimer
  • Community Guidelines
Company
  • About
  • Contact
  • FAQ
Legal
  • Privacy Policy
  • Terms of Service
  • Refund Policy
  • Cookie Policy
  • Subscription Policy
© 2026 MAKAUT Study Dev Hub. All rights reserved.
Platform version: v1.0.0
Viva Questions/PCC-CS503
Semester 5PCC-CS503

Object Oriented Programming (PCC-CS503) Viva Questions and Answers

35 Questions•6 min read
Prepared from MAKAUT past-year question papers.
Practice Mode:All answers visible
Jump to Topic
OOP Basics (1)Java Architecture (1)String Handling (1)Operators (2)Java File Structure (1)Polymorphism (2)Abstraction (1)Constructors (2)Parameter Passing (1)Keywords (1)Memory Management (1)Exception Handling (4)Multithreading (4)Applets (3)Packages (2)Access Control (1)Type Casting (1)Wrapper Classes (1)Input/Output (1)I/O Streams (1)Data Types (1)Literals (1)Java vs C++ (1)

OOP Basics

1 question
Q1.EASY

What are the four main characteristics of OOP?

Encapsulation, inheritance, polymorphism, and abstraction. Encapsulation bundles data and methods; inheritance reuses code; polymorphism allows one interface with many forms; abstraction hides implementation details.

Java Architecture

1 question
Q2.MEDIUM

Why is Java called a compiled-interpreted language?

Java source is first compiled to bytecode by javac, then interpreted by the JVM. This two-step process allows platform independence.

String Handling

1 question
Q3.EASY

What is the difference between String and StringBuffer?

String objects are immutable, while StringBuffer objects are mutable. StringBuffer is thread-safe and used when frequent modifications are needed.

Operators

2 questions
Q4.EASY

What is the output of: int x=3, y=10; System.out.println(y % x);

The output is 1. The modulus operator returns the remainder of division, and 10 divided by 3 leaves remainder 1.
Q32.EASY

What is the output of: double r=9.8, pi=3.14; a=pi*r*r; System.out.println(a);

The output is approximately 301.5656. It calculates the area of a circle with radius 9.8.

Java File Structure

1 question
Q5.EASY

What is the correct ordering of package, import, and class declarations in a Java file?

Package declaration first, then import statements, then class declaration. This order is mandatory.

Polymorphism

2 questions
Q6.MEDIUM

What is the difference between method overloading and method overriding?

Overloading occurs in the same class with different parameter lists; overriding occurs in subclasses with the same signature. Overloading is compile-time, overriding is runtime.
Q7.MEDIUM

Explain dynamic method dispatch with an example.

Dynamic method dispatch is runtime polymorphism where a superclass reference calls an overridden method in a subclass. For example, if Animal has sound() and Dog overrides it, Animal a = new Dog(); a.sound() calls Dog's sound().

Abstraction

1 question
Q8.MEDIUM

What is the difference between an abstract class and an interface?

An abstract class can have concrete methods and state, while an interface (prior to Java 8) only has abstract methods and constants. A class can extend only one abstract class but implement multiple interfaces.

Constructors

2 questions
Q9.EASY

What is a constructor? What is the difference between parametric and non-parametric constructors?

A constructor initializes objects. A non-parametric (default) constructor takes no arguments; a parametric constructor takes arguments to initialize instance variables with specific values.
Q10.EASY

Can a constructor be overloaded?

Yes, constructors can be overloaded by having different parameter lists. This allows objects to be initialized in different ways.

Parameter Passing

1 question
Q11.MEDIUM

What is the difference between call by value and call by reference in Java?

Java is always call by value; for objects, the reference is passed by value. This means changes to the object's state are visible, but reassigning the reference does not affect the caller.

Keywords

1 question
Q12.MEDIUM

What is the difference between final, finally, and finalize?

final is a keyword for constants, preventing inheritance or overriding; finally is a block for cleanup in exception handling; finalize is a method called by the garbage collector before object destruction.

Memory Management

1 question
Q13.EASY

What is garbage collection in Java?

Garbage collection automatically reclaims memory from objects that are no longer referenced. It is handled by the JVM, preventing memory leaks.

Exception Handling

4 questions
Q14.MEDIUM

What is the difference between an error and an exception?

Errors are serious problems that applications should not catch (e.g., OutOfMemoryError); exceptions are recoverable conditions that can be caught and handled.
Q15.EASY

What is the base class of Error and Exception?

Both Error and Exception extend the Throwable class. Throwable is the root of the exception hierarchy.
Q16.MEDIUM

Differentiate between throw and throws.

throw is used to explicitly throw an exception object; throws declares that a method may throw exceptions. throw is followed by an instance, throws by exception classes.
Q17.MEDIUM

How do you create a user-defined exception?

Create a class that extends Exception or RuntimeException. For example: class MyException extends Exception { }.

Multithreading

4 questions
Q18.MEDIUM

What is multithreading? Why does Java have two ways to create threads?

Multithreading allows concurrent execution of multiple threads. Java provides Thread class and Runnable interface; implementing Runnable is better because it allows extending other classes and promotes separation of concerns.
Q19.MEDIUM

Explain the life cycle of a thread.

A thread goes through New, Runnable, Running, Blocked/Waiting, and Terminated states. Transitions occur via methods like start(), sleep(), wait(), and notify().
Q20.MEDIUM

How do threads communicate with each other?

Threads communicate using wait(), notify(), and notifyAll() methods. These must be called from within a synchronized context.
Q21.MEDIUM

What is the difference between wait() and sleep()?

wait() releases the lock and waits for notification; sleep() does not release the lock and pauses for a specified time. wait() is from Object, sleep() from Thread.

Applets

3 questions
Q22.MEDIUM

What is the life cycle of an applet?

The applet life cycle includes init(), start(), paint(), stop(), and destroy(). init() initializes, start() begins execution, paint() draws, stop() pauses, destroy() cleans up.
Q23.EASY

List various attributes of the applet tag used in HTML.

Common attributes include code, width, height, codebase, archive, and alt. They specify the applet class, dimensions, base URL, and alternative text.
Q24.MEDIUM

How is an applet different from a frame?

An applet runs in a browser or applet viewer and has a restricted security model; a frame is a standalone window. Applets do not have a main() method; frames are created by applications.

Packages

2 questions
Q25.EASY

What is a package? What are its benefits?

A package is a namespace for organizing classes and interfaces. Benefits include avoiding name conflicts, access control, and easier maintenance.
Q26.MEDIUM

How can you create your own package and add classes to it?

Use the package statement as the first line in a Java file, e.g., package mypack;. Compile with javac -d . MyClass.java to create the directory structure.

Access Control

1 question
Q27.MEDIUM

What are access specifiers in Java? Explain protected.

Access specifiers are private, default, protected, and public. Protected members are accessible within the same package and by subclasses in other packages.

Type Casting

1 question
Q28.EASY

What is the difference between implicit and explicit casting?

Implicit casting (widening) is automatic, e.g., int to long; explicit casting (narrowing) requires a cast operator, e.g., double to int.

Wrapper Classes

1 question
Q29.EASY

What is a wrapper class? Give an example.

Wrapper classes convert primitive types to objects, e.g., Integer for int. They are used in collections and for utility methods like parseInt().

Input/Output

1 question
Q30.EASY

What is the Scanner class? Which package does it reside in?

Scanner is used to read input from various sources. It resides in java.util package.

I/O Streams

1 question
Q31.MEDIUM

What is the difference between byte stream and character stream?

Byte streams handle raw binary data (InputStream/OutputStream); character streams handle text data with encoding (Reader/Writer).

Data Types

1 question
Q33.EASY

What is the range of the char type in Java?

The char type is 16-bit unsigned, ranging from 0 to 65535 (0 to 2^16-1). It represents Unicode characters.

Literals

1 question
Q34.EASY

What is a literal in Java?

A literal is a fixed value in source code, e.g., 100, 'A', true, "Hello". They represent constant values of primitive types and strings.

Java vs C++

1 question
Q35.MEDIUM

What is the difference between Java and C++ regarding language functions?

Java does not support pointers, operator overloading, or multiple inheritance of classes; C++ does. Java has automatic garbage collection; C++ requires manual memory management.

Frequently Asked Viva Voce Questions

High-priority theoretical and lab evaluation questions typically tested by MAKAUT external examiners.

Related Course Resources

PYQObject Oriented Programming Solved PYQs
Open resource
IMPORTANTObject Oriented Programming Important Questions
Open resource
HUBObject Oriented Programming Subject Overview
Open resource
SYLLABUSObject Oriented Programming Syllabus & Handouts
Open resource

On This Page

23 Units
OOP Basics1
Java Architecture1
String Handling1
Operators2
Java File Structure1
Polymorphism2
Abstraction1
Constructors2
Parameter Passing1
Keywords1
Memory Management1
Exception Handling4
Multithreading4
Applets3
Packages2
Access Control1
Type Casting1
Wrapper Classes1
Input/Output1
I/O Streams1
Data Types1
Literals1
Java vs C++1