Save 37% off PRO during our Black Friday Sale! »

Object Oriented Programming Q&A

73dac075c95439402b3efb7ec7177068?s=47 Manish
August 01, 2021

Object Oriented Programming Q&A

Test your knowledge on OOPS concepts and verify with answers

73dac075c95439402b3efb7ec7177068?s=128

Manish

August 01, 2021
Tweet

Transcript

  1. OBJECT ORIENTED PROGRAMMING OOPS CONCEPTS QUESTIONS AND ANSWERS

  2. OBJECT-ORIENTED PROGRAMMING INFLUENCE GRAPH

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

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