CS 151 EXAM QUESTIONS AND
ANSWERS. VERIFIED 2025/2026.
Which one(s) is (are) class member(s) in OOP?
- Instance Variables
- Attributes
- Methods
- In Java, classes don't have member - ANS - Instance Variables
- Attributes
- Methods
Which one is the correct order of "Java access modifiers" from the "least restriction to the
most"?
- private, default, protected, public
- private, protected, default, public
- public, default, protected, private
- public, protected, default, private - ANS - public, protected, default, private
What is the definition of "paradigm"? - ANS The way that we model real universe entities,
their relationships and interactions in cyberspace.
What is the definition of a "class" in OOP? - ANS A class is an abstraction of similar objects.
For example, if we have a river, ocean, or pond. The class would just be water.
1 @COPYRIGHT 2025/2026 ALLRIGHTS RESERVED.
,Pick all true statements in OOP and Java:
- "Instance variables" in Java is equivalent to "attribute" in OOP
- "Method" in Java is equivalent to "attribute" in OOP
- "Method" in Java is equivalent to "behavior" in OOP
- "Instance variables" in Java is equivalent to "behavior" in OOP - ANS "Instance variables" in
Java is equivalent to "attribute" in OOP
"Method" in Java is equivalent to "behavior" in OOP
Pick all the true statements in OOP:
- We model the "behavior" of the real universe's entities with "java methods"
- We model the real universe's entities by "objects"
- "Identity" of an object is the name we give to it
- We model the behavior of the real universe's entities with Java "instance variables" - ANS -
We model the "behavior" of the real universe's entities with "java methods"
- We model the real universe's entities by "objects"
What are the "4 major paradigms" in computer science? Just give their name - ANS -
Imperative paradigms
- Functional paradigms
- Logical paradigms
- Object oriented paradigm
What is the definition of "state" of an object? - ANS State of an object is the set of values of
the attributes at any moment
Instance variables and methods are class "class members" (T/F) - ANS True
2 @COPYRIGHT 2025/2026 ALLRIGHTS RESERVED.
,An "object" is the instance of its "class" (T/F) - ANS True
Pick all true statements about "functional-spec":
- It shows the class' relationship
- It describes the required features
- It contains UML diagrams
- NONE - ANS - It describes the required features
Pick all true statements in OOP and programming languages supporting OOP like Java:
- We model the "behavior" of the real universe's entities using "java methods"
- We model the real universe's entities using "objects"
- "Identity" of an object is the name we (as developer) give to it
- We model the "behavior" of the real universe's entities using Java "instance variables" -
ANS - We model the "behavior" of the real universe's entities using "java methods"
- We model the real universe's entities using "objects"
What does "API" stand for? What is the definition? - ANS - An API stands for application
programming interface.
- It is an interface that allows every single variable to be visible to the outside world. Whether a
class (or library) is exposed to the outside world (or can be seen by other classes)
In Java, if we import a class but don't use it, it's NOT a "dependency" (T/F) - ANS False
The artifact of design phase is called "functional-spec" (T/F) - ANS False
3 @COPYRIGHT 2025/2026 ALLRIGHTS RESERVED.
, Pick all the true statements about "design phase" of SDLC
- To discover "responsibilities", we should look for "nouns" in the problem statement/function-
spec
- To discover "responsibilities", we should look for "verbs" in the problem statement/function-
spec
- To discover "classes", we should look for "verbs" in the problem statement/functional spec
- To discover "classes", we should look for "nouns" in the problem statement/functional spec -
ANS - To discover "responsibilities", we should look for "verbs" in the problem
statement/function-spec
- To discover "classes", we should look for "nouns" in the problem statement/functional spec
Pick all true statements about "problem statement" in SDLC
- it gives a final solution to a problem
- None
- It specifies the programming language
- Theoretically, it is a clear description of the problem - ANS Theoretically, it is a clear
description of the problem
ClassA "aggregates" ClassB if.....
- ClassA contains ClassB in its "import" part
- ClassB contains ClassA in its "instance variables"
- ClassB contains ClassA in its "local variables"
- ClassA contains ClassB in its "instance variables" - ANS - ClassA contains ClassB in its
"instance variables"
Pick all true statements about "technical-spec":
- It contains UML diagrams (the classes and their relationship)
- It's readable by the client
4 @COPYRIGHT 2025/2026 ALLRIGHTS RESERVED.
ANSWERS. VERIFIED 2025/2026.
Which one(s) is (are) class member(s) in OOP?
- Instance Variables
- Attributes
- Methods
- In Java, classes don't have member - ANS - Instance Variables
- Attributes
- Methods
Which one is the correct order of "Java access modifiers" from the "least restriction to the
most"?
- private, default, protected, public
- private, protected, default, public
- public, default, protected, private
- public, protected, default, private - ANS - public, protected, default, private
What is the definition of "paradigm"? - ANS The way that we model real universe entities,
their relationships and interactions in cyberspace.
What is the definition of a "class" in OOP? - ANS A class is an abstraction of similar objects.
For example, if we have a river, ocean, or pond. The class would just be water.
1 @COPYRIGHT 2025/2026 ALLRIGHTS RESERVED.
,Pick all true statements in OOP and Java:
- "Instance variables" in Java is equivalent to "attribute" in OOP
- "Method" in Java is equivalent to "attribute" in OOP
- "Method" in Java is equivalent to "behavior" in OOP
- "Instance variables" in Java is equivalent to "behavior" in OOP - ANS "Instance variables" in
Java is equivalent to "attribute" in OOP
"Method" in Java is equivalent to "behavior" in OOP
Pick all the true statements in OOP:
- We model the "behavior" of the real universe's entities with "java methods"
- We model the real universe's entities by "objects"
- "Identity" of an object is the name we give to it
- We model the behavior of the real universe's entities with Java "instance variables" - ANS -
We model the "behavior" of the real universe's entities with "java methods"
- We model the real universe's entities by "objects"
What are the "4 major paradigms" in computer science? Just give their name - ANS -
Imperative paradigms
- Functional paradigms
- Logical paradigms
- Object oriented paradigm
What is the definition of "state" of an object? - ANS State of an object is the set of values of
the attributes at any moment
Instance variables and methods are class "class members" (T/F) - ANS True
2 @COPYRIGHT 2025/2026 ALLRIGHTS RESERVED.
,An "object" is the instance of its "class" (T/F) - ANS True
Pick all true statements about "functional-spec":
- It shows the class' relationship
- It describes the required features
- It contains UML diagrams
- NONE - ANS - It describes the required features
Pick all true statements in OOP and programming languages supporting OOP like Java:
- We model the "behavior" of the real universe's entities using "java methods"
- We model the real universe's entities using "objects"
- "Identity" of an object is the name we (as developer) give to it
- We model the "behavior" of the real universe's entities using Java "instance variables" -
ANS - We model the "behavior" of the real universe's entities using "java methods"
- We model the real universe's entities using "objects"
What does "API" stand for? What is the definition? - ANS - An API stands for application
programming interface.
- It is an interface that allows every single variable to be visible to the outside world. Whether a
class (or library) is exposed to the outside world (or can be seen by other classes)
In Java, if we import a class but don't use it, it's NOT a "dependency" (T/F) - ANS False
The artifact of design phase is called "functional-spec" (T/F) - ANS False
3 @COPYRIGHT 2025/2026 ALLRIGHTS RESERVED.
, Pick all the true statements about "design phase" of SDLC
- To discover "responsibilities", we should look for "nouns" in the problem statement/function-
spec
- To discover "responsibilities", we should look for "verbs" in the problem statement/function-
spec
- To discover "classes", we should look for "verbs" in the problem statement/functional spec
- To discover "classes", we should look for "nouns" in the problem statement/functional spec -
ANS - To discover "responsibilities", we should look for "verbs" in the problem
statement/function-spec
- To discover "classes", we should look for "nouns" in the problem statement/functional spec
Pick all true statements about "problem statement" in SDLC
- it gives a final solution to a problem
- None
- It specifies the programming language
- Theoretically, it is a clear description of the problem - ANS Theoretically, it is a clear
description of the problem
ClassA "aggregates" ClassB if.....
- ClassA contains ClassB in its "import" part
- ClassB contains ClassA in its "instance variables"
- ClassB contains ClassA in its "local variables"
- ClassA contains ClassB in its "instance variables" - ANS - ClassA contains ClassB in its
"instance variables"
Pick all true statements about "technical-spec":
- It contains UML diagrams (the classes and their relationship)
- It's readable by the client
4 @COPYRIGHT 2025/2026 ALLRIGHTS RESERVED.