Podcast
Questions and Answers
What is a class that inherits called?
What is a class that inherits called?
- Polymorphic class
- Superclass
- Derived class (correct)
- Abstract data type
What is the central theme in object-oriented programming and languages that support it?
What is the central theme in object-oriented programming and languages that support it?
- Polymorphism
- Inheritance (correct)
- Abstraction
- Encapsulation
What are subprograms that define operations on objects called?
What are subprograms that define operations on objects called?
- Methods (correct)
- Functions
- Procedures
- Routines
What allows new classes to be defined in terms of existing ones in object-oriented programming?
What allows new classes to be defined in terms of existing ones in object-oriented programming?
What is a characteristic of a nested class in Java?
What is a characteristic of a nested class in Java?
What is true about dynamic binding in Java?
What is true about dynamic binding in Java?
What is a storage structure for instance variables in Java?
What is a storage structure for instance variables in Java?
What is the purpose of reflection in a programming language?
What is the purpose of reflection in a programming language?
What does the getClass method of Class return in Java?
What does the getClass method of Class return in Java?
What does the Method class's invoke method do in Java?
What does the Method class's invoke method do in Java?
What is a downside of reflection in Java?
What is a downside of reflection in Java?
What are the major design issues involved in object-oriented programming (OOP)?
What are the major design issues involved in object-oriented programming (OOP)?
What is a characteristic of Java as a programming language?
What is a characteristic of Java as a programming language?
What is a use case of reflection in software tools?
What is a use case of reflection in software tools?
What does the getMethods method of Class return in Java?
What does the getMethods method of Class return in Java?
What is a limitation of reflection in Java?
What is a limitation of reflection in Java?
What is the entire collection of methods of an object called?
What is the entire collection of methods of an object called?
How can a class modify an inherited method?
How can a class modify an inherited method?
What are the two kinds of variables in a class?
What are the two kinds of variables in a class?
What does dynamic binding allow?
What does dynamic binding allow?
What does an abstract class include?
What does an abstract class include?
What are the design issues for OOP languages?
What are the design issues for OOP languages?
What is the relationship of subclasses to their parent class?
What is the relationship of subclasses to their parent class?
What is a disadvantage of Multiple Inheritance?
What is a disadvantage of Multiple Inheritance?
Where can object allocation and deallocation occur?
Where can object allocation and deallocation occur?
What should be considered for efficiency?
What should be considered for efficiency?
What does an abstract method not include?
What does an abstract method not include?
What can multiple inheritance allow a new class to inherit from?
What can multiple inheritance allow a new class to inherit from?
Which language supports multiple inheritance and dynamic binding through virtual methods and pure virtual functions?
Which language supports multiple inheritance and dynamic binding through virtual methods and pure virtual functions?
Which language has a category that provides some benefits of multiple inheritance through interfaces?
Which language has a category that provides some benefits of multiple inheritance through interfaces?
Which language allows reexportation to make a member visible in a subclass, even if it was originally inaccessible due to private derivation?
Which language allows reexportation to make a member visible in a subclass, even if it was originally inaccessible due to private derivation?
Which language explicitly calls the finalize method when the garbage collector is about to reclaim the storage occupied by the object?
Which language explicitly calls the finalize method when the garbage collector is about to reclaim the storage occupied by the object?
Which language requires the programmer to decide at design time which methods will be statically bound and which must be dynamically bound?
Which language requires the programmer to decide at design time which methods will be statically bound and which must be dynamically bound?
Which language has wrapper classes for primitive types and allocates objects heap-dynamically with new?
Which language has wrapper classes for primitive types and allocates objects heap-dynamically with new?
Which language supports single inheritance and dynamic binding for all messages unless the method is final or static?
Which language supports single inheritance and dynamic binding for all messages unless the method is final or static?
Which language provides elaborate access controls to class entities such as private, public, and protected?
Which language provides elaborate access controls to class entities such as private, public, and protected?
Which language has a mixed typing system, constructors, destructors, and elaborate access controls to class entities?
Which language has a mixed typing system, constructors, destructors, and elaborate access controls to class entities?
Which language allows subclassing to be declared with access controls such as private or public, defining potential changes in access by subclasses?
Which language allows subclassing to be declared with access controls such as private or public, defining potential changes in access by subclasses?
Which language disallows overriding and allows static binding for methods that are final or static?
Which language disallows overriding and allows static binding for methods that are final or static?
Which language has differences in support of OOP, with extensive access controls, multiple inheritance, and dynamic binding?
Which language has differences in support of OOP, with extensive access controls, multiple inheritance, and dynamic binding?
Flashcards are hidden until you start studying
Study Notes
OOP Support in C++ and Java
- C++ is an OOP language evolved from C and SIMULA 67, featuring mixed typing system, constructors, destructors, and elaborate access controls to class entities.
- In C++, inheritance is supported, and access controls for members include private, public, and protected.
- Subclassing in C++ can be declared with access controls such as private or public, defining potential changes in access by subclasses.
- In C++, reexportation allows making a member visible in a subclass, even if it was originally inaccessible due to private derivation.
- C++ supports multiple inheritance and dynamic binding through virtual methods and pure virtual functions.
- Dynamic binding in C++ allows calling methods through polymorphic variables and binding to messages.
- C++ provides extensive access controls, multiple inheritance, and requires the programmer to decide at design time which methods will be statically bound and which must be dynamically bound.
- Java, closely related to C++, has all data as objects except primitive types, with wrapper classes for primitive types, and objects are heap-dynamic and allocated with new.
- In Java, single inheritance is supported and an abstract class category provides some benefits of multiple inheritance through interfaces.
- All messages in Java are dynamically bound to methods unless the method is final or static, which disallows overriding and allows static binding.
- Java's finalize method is implicitly called when the garbage collector is about to reclaim the storage occupied by the object.
- Overall, C++ and Java have differences in support of OOP, with C++ providing extensive access controls, multiple inheritance, and dynamic binding, while Java supports single inheritance and dynamic binding for all messages.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.