Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Object Oriented Programming Q&A

Manish
August 01, 2021

Object Oriented Programming Q&A

Test your knowledge on OOPS concepts and verify with answers

Manish

August 01, 2021
Tweet

More Decks by Manish

Other Decks in Programming

Transcript

  1. 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.
  2. 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!
  3. 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
  4. 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.
  5. 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.
  6. 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
  7. 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
  8. 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
  9. 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.
  10. 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.
  11. 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.
  12. 6. WHAT IS THE PROGRAMMING TERM FOR “BRING AN OBJECT

    INTO BEING?” A. Antidisestablishmentarianism B. Instantiation. C. Objectification D. Instance definition E. Object definition
  13. 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.”
  14. 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
  15. 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
  16. 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!
  17. 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
  18. 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.
  19. 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
  20. 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.
  21. 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
  22. 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
  23. 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!