Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

SE C OOPCG Unit 1

Total questions: 35

Worksheet time: 12mins

Name
Class
Date
1.

Which of the following best defines a programming paradigm?

a)

A design pattern

b)

A way to structure and write programs

c)

A syntax rule in programming

d)

A data structure used in programs

2.

Which is NOT a primary programming paradigm?

a)

Procedural

b)

Functional

c)

Relational

d)

Logic

3.

Programming paradigms influence the way a programmer…

a)

Thinks about software design

b)

Writes hardware drivers

c)

Designs GUIs only

d)

Formats output data

4.

Which paradigm is based on the concept of procedure calls and step-by-step instructions?

a)

Object-Oriented

b)

Functional

c)

Procedural

d)

Logic

5.

Which programming paradigm is mostly used in Prolog?

a)

Functional

b)

Object-Oriented

c)

Procedural

d)

Logic and Rule-Based

6.

Which of the following languages is predominantly functional?

a)

Java

b)

Haskell

c)

Python

d)

C++

7.

Which paradigm supports the concepts of classes and inheritance?

a)

Procedural

b)

Functional

c)

Object-Oriented

d)

Logic-Based

8.

In a logic-based programming language, computation is performed by…

a)

Evaluating expressions

b)

Calling functions

c)

Making assertions and queries

d)

Creating objects

9.

What is the key motivation for Object-Oriented Programming?

a)

Speed

b)

Reusability and Modularity

c)

Error detection

d)

Low-level hardware access

10.

OOP helps in managing complexity by…

a)

Reducing the number of lines of code

b)

Using only global variables

c)

Encapsulating data and behavior

d)

Removing all comments

11.

What concept in Java serves a similar role to namespaces in other languages like C++?

a)

Classes

b)

Packages

c)

Interfaces

d)

Comments

12.

Which keyword is used to define a class in Java?

a)

define

b)

object

c)

class

d)

method

13.

Which of the following is used to create an object in Java?

a)

object = class();

b)

object obj = new class();

c)

class obj = new class();

d)

ClassName obj = new ClassName();

14.

Data members in a class refer to…

a)

Functions

b)

Variables

c)

Keywords

d)

Classes

15.

Which term refers to functions defined inside a class?

a)

Data members

b)

Modules

c)

Methods

d)

Objects

16.

Encapsulation is achieved using…

a)

Public variables

b)

Constructors

c)

Private variables and public methods

d)

Abstract methods

17.

Data abstraction allows a programmer to…

a)

Write low-level code

b)

Focus on what an object does, not how

c)

Access all internals of the class

d)

Create only static methods

18.

Inheritance allows…

a)

Sharing files

b)

One class to acquire properties of another

c)

Executing multiple threads

d)

None of the above

19.

Which keyword is used to inherit a class in Java?

a)

implements

b)

inherits

c)

extends

d)

override

20.

Polymorphism means…

a)

One name, multiple forms

b)

One object, one behavior

c)

Many classes in one file

d)

Multiple packages

21.

Method overloading is an example of…

a)

Compile-time polymorphism

b)

Runtime polymorphism

c)

Inheritance

d)

Abstraction

22.

Which of the following is true for Java?

a)

Java supports only procedural programming

b)

Java does not support inheritance

c)

Java supports full object-oriented principles

d)

Java lacks encapsulation

23.

The documentation section in a Java program usually contains…

a)

JVM info

b)

Java version

c)

Comments about the program

d)

Import statements

24.

Which keyword is used to define a package in Java?

a)

import

b)

package

c)

class

d)

define

25.

The import keyword in Java is used to…

a)

Import packages and classes

b)

Compile classes

c)

Define variables

d)

Allocate memory

26.

What does JVM stand for?

a)

Java Verified Machine

b)

Java Virtual Machine

c)

Java Value Model

d)

Java Variable Manager

27.

What is the role of the JVM?

a)

Compile source code

b)

Manage package imports

c)

Convert bytecode into machine code

d)

Upload files

28.

Java programs are first compiled into…

a)

Native code

b)

Source code

c)

Bytecode

d)

Executables

29.

What is the extension of a Java compiled file?

a)

.java

b)

.exe

c)

.class

d)

.jre

30.

Which of the following is a valid selection statement in Java?

a)

if

b)

while

c)

for

d)

switch

31.

Which Java statement is used to choose between many options?

a)

loop

b)

switch

c)

select

d)

case-if

32.

What is the default keyword used for in a switch statement?

a)

Start loop

b)

End condition

c)

Execute when no case matches

d)

Skip to the next statement

33.

Which is true about if-else statements?

a)

Only one block can run

b)

All blocks run

c)

It is used for looping

d)

It handles exceptions

34.

A method with the same name in two classes related by inheritance demonstrates…

a)

Method overloading

b)

Static binding

c)

Method overriding

d)

Exception handling

35.

What will be the output of the following Java code?

a)

Animal makes sound
Animal makes sound

b)

Dog barks
Cat meows

c)

Compile-time error due to reassigning reference

d)

Runtime error because of invalid casting