Slide 1

Slide 1 text

OBJECT ORIENTED PROGRAMMING OOPS CONCEPTS QUESTIONS AND ANSWERS

Slide 2

Slide 2 text

OBJECT-ORIENTED PROGRAMMING INFLUENCE GRAPH

Slide 3

Slide 3 text

1. WHICH OF THE FOLLOWING IS TRUE OF OBJECTS IN PROGRAMMING (3 CORRECT ANSWERS)? 
 CAREFUL, THERE ARE SEVERAL CORRECT ANSWERS. A. They are not used to represent real-world objects; this is just an analogy to help us to talk about them. B. They can be used to model real-world objects. C. They can also be called “instances of a class.” D. They help programmers to group descriptions and details together.

Slide 4

Slide 4 text

1. WHICH OF THE FOLLOWING IS TRUE OF OBJECTS IN PROGRAMMING (3 CORRECT ANSWERS)? 
 CAREFUL, THERE ARE SEVERAL CORRECT ANSWERS. 
 A. They are not used to represent real-world objects; this is just an analogy to help us to talk about them. B. They can be used to model real-world objects. C. They can also be called “instances of a class.” D. They help programmers to group descriptions and details together. 
 Software objects are modeled off of real-world objects. That’s part of why they’re so useful when designing computer systems for the real world!

Slide 5

Slide 5 text

2. WHICH OF THE FOLLOWING IS TRUE ABOUT ATTRIBUTES? A. Attributes describe what an object is composed of. B. Attributes are used to define security access. C. Attributes define what actions you can take with an object. D. Attributes cannot have values

Slide 6

Slide 6 text

2. WHICH OF THE FOLLOWING IS TRUE ABOUT ATTRIBUTES? A. Attributes describe what an object is composed of. B. Attributes are used to define security access. C. Attributes define what actions you can take with an object. D. Attributes cannot have values 
 
 
 Objects have a list of attributes that define what they’re made up of. This is not to be confused with methods, which define behaviors, or rather, what you can do with an object’s attributes. Security access is defined by the access control.

Slide 7

Slide 7 text

3. WHICH OF THE FOLLOWING IS TRUE ABOUT METHODS? (2 CORRECT ANSWERS) 
 CAREFUL, THERE ARE SEVERAL CORRECT ANSWERS. A. Methods is another way of referring to famous rappers from the 90s. B. Methods define what you can do with an object’s attributes. C. Methods refer to an object’s behavior. D. Methods are what you use to plan out what’s in your object.

Slide 8

Slide 8 text

3. WHICH OF THE FOLLOWING IS TRUE ABOUT METHODS? (2 CORRECT ANSWERS) 
 CAREFUL, THERE ARE SEVERAL CORRECT ANSWERS. A. Methods is another way of referring to famous rappers from the 90s. B. Methods define what you can do with an object’s attributes. C. Methods refer to an object’s behavior. D. Methods are what you use to plan out what’s in your object. 
 
 Methods have nothing to do with rap (obviously) and you plan our your object using a class

Slide 9

Slide 9 text

4. WHAT DO WE MEAN BY “ACCESS CONTROL” IN PROGRAMMING? A. It specifies who has access to the methods in your object. B. It’s a fancy security card with a barcode that you use to get into secure places, like the FBI building or the secret recipe room of a beverage company. C. It’s an attribute of an object. D. It defines who can open your cellar door

Slide 10

Slide 10 text

4. WHAT DO WE MEAN BY “ACCESS CONTROL” IN PROGRAMMING? A. It specifies who has access to the methods in your object. B. It’s a fancy security card with a barcode that you use to get into secure places, like the FBI building or the secret recipe room of a beverage company. C. It’s an attribute of an object. D. It defines who can open your cellar door 
 In programming, access control only defines who can use your methods or the degree of access to them (private, public, etc.), not your object in general. Methods define what can be done with your attributes, not access control. Answers 2 & 4 are good analogies, but not the actual definition of access control

Slide 11

Slide 11 text

5. WHICH OF THE FOLLOWING IS TRUE OF THE TERM “CLASS” IN PROGRAMMING? (2 CORRECT ANSWERS) 
 CAREFUL, THERE ARE SEVERAL CORRECT ANSWERS. A. In programming, “a class” is a synonym for “an object.” B. A class is a plan or blueprint for your object. C. A class defines the attributes, methods, and access control for an object. D. Class is something all programmers have. E. Classes are constructed after you bring your object into being.

Slide 12

Slide 12 text

5. WHICH OF THE FOLLOWING IS TRUE OF THE TERM “CLASS” IN PROGRAMMING? (2 CORRECT ANSWERS) 
 CAREFUL, THERE ARE SEVERAL CORRECT ANSWERS. A. In programming, “a class” is a synonym for “an object.” B. A class is a plan or blueprint for your object. C. A class defines the attributes, methods, and access control for an object. D. Class is something all programmers have. E. Classes are constructed after you bring your object into being.

Slide 13

Slide 13 text

Objects and classes aren’t the same things, though they are connected. Classes are a plan for your object. Using this plan, you can bring an object into being. It doesn’t really make sense to make an object first and the plan after. That’d be like building a house before you create a blueprint! Also, some programmers may be classy, but that’s not really what’s meant by “class” in programming.

Slide 14

Slide 14 text

6. WHAT IS THE PROGRAMMING TERM FOR “BRING AN OBJECT INTO BEING?” A. Antidisestablishmentarianism B. Instantiation. C. Objectification D. Instance definition E. Object definition

Slide 15

Slide 15 text

6. WHAT IS THE PROGRAMMING TERM FOR “BRING AN OBJECT INTO BEING?” A. Antidisestablishmentarianism B. Instantiation. C. Objectification D. Instance definition E. Object definition We instantiate an object when we want to bring it into being. This is why an object can be referred to as “an instance of a class.”

Slide 16

Slide 16 text

7. CAN OBJECTS OF THE SAME CLASS DIFFER FROM ONE ANOTHER?” A. Yes, because objects can contradict any of the requirements set out by their class B. Yes, different objects can have different values for their attributes. C. No, objects must be exact copies in order to follow the requirements set out by the class D. No, if you want different types of the same object, you should make a different class for each one

Slide 17

Slide 17 text

7. CAN OBJECTS OF THE SAME CLASS DIFFER FROM ONE ANOTHER?” A. Yes, because objects can contradict any of the requirements set out by their class B. Yes, different objects can have different values for their attributes. C. No, objects must be exact copies in order to follow the requirements set out by the class D. No, if you want different types of the same object, you should make a different class for each one

Slide 18

Slide 18 text

Regardless of the type of object you’re making, the values of an attribute can vary for each object — as long as they respect the guidelines set out by the class! Instances of a class are not exact copies. This is part of why using objects is so useful!

Slide 19

Slide 19 text

8. WHICH OF THE FOLLOWING IS TRUE ABOUT COMPLEX SYSTEMS? A. An object cannot have another object as an attribute. B. Objects do not send messages to one another. C. Objects can communicate with one another by sending messages D. Objects are isolated and cannot be used in complex systems

Slide 20

Slide 20 text

8. WHICH OF THE FOLLOWING IS TRUE ABOUT COMPLEX SYSTEMS? A. An object cannot have another object as an attribute. B. Objects do not send messages to one another. C. Objects can communicate with one another by sending messages D. Objects are isolated and cannot be used in complex systems 
 
 Complex systems are networks of associated objects that communicate via messages. Objects can have another object as an attribute.

Slide 21

Slide 21 text

9. WHAT IS ENCAPSULATION? A. It refers to hiding information in an object in order to simplify its use. B. It’s refers to bundling attributes, methods, and access control together in one unit. C. It when two objects interact within the same system D. It’s an eco-friendly version of an espresso pod

Slide 22

Slide 22 text

9. WHAT IS ENCAPSULATION? A. It refers to hiding information in an object in order to simplify its use. B. It’s refers to bundling attributes, methods, and access control together in one unit. C. It when two objects interact within the same system D. It’s an eco-friendly version of an espresso pod 
 
 Encapsulation bundles together data and behaviors — like attributes, methods, and access control — but it doesn’t necessarily hide this information.

Slide 23

Slide 23 text

10. WHAT IS ABSTRACTION? A. It allows us to bundle together information to simplify its utilization. B. It’s a method of highlighting the complexity of a particular object, in order to ensure that it’s used correctly. C. It’s an art movement from the 20th century that has heavily influenced programmers D. It means only showing what’s relevant or necessary for using an object

Slide 24

Slide 24 text

10. WHAT IS ABSTRACTION? A. It allows us to bundle together information to simplify its utilization. B. It’s a method of highlighting the complexity of a particular object, in order to ensure that it’s used correctly. C. It’s an art movement from the 20th century that has heavily influenced programmers D. It means only showing what’s relevant or necessary for using an object

Slide 25

Slide 25 text

Abstraction means hiding the more complex mechanisms of an object in order to simplify use, leaving only what’s relevant or useful available to the person using it. The bundling together of information is referred to as encapsulation!