Podcast
Questions and Answers
What is a class that inherits called?
What is a class that inherits called?
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?
What are subprograms that define operations on objects called?
What are subprograms that define operations on objects called?
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?
Signup and view all the answers
What is a characteristic of a nested class in Java?
What is a characteristic of a nested class in Java?
Signup and view all the answers
What is true about dynamic binding in Java?
What is true about dynamic binding in Java?
Signup and view all the answers
What is a storage structure for instance variables in Java?
What is a storage structure for instance variables in Java?
Signup and view all the answers
What is the purpose of reflection in a programming language?
What is the purpose of reflection in a programming language?
Signup and view all the answers
What does the getClass method of Class return in Java?
What does the getClass method of Class return in Java?
Signup and view all the answers
What does the Method class's invoke method do in Java?
What does the Method class's invoke method do in Java?
Signup and view all the answers
What is a downside of reflection in Java?
What is a downside of reflection in Java?
Signup and view all the answers
What are the major design issues involved in object-oriented programming (OOP)?
What are the major design issues involved in object-oriented programming (OOP)?
Signup and view all the answers
What is a characteristic of Java as a programming language?
What is a characteristic of Java as a programming language?
Signup and view all the answers
What is a use case of reflection in software tools?
What is a use case of reflection in software tools?
Signup and view all the answers
What does the getMethods method of Class return in Java?
What does the getMethods method of Class return in Java?
Signup and view all the answers
What is a limitation of reflection in Java?
What is a limitation of reflection in Java?
Signup and view all the answers
What is the entire collection of methods of an object called?
What is the entire collection of methods of an object called?
Signup and view all the answers
How can a class modify an inherited method?
How can a class modify an inherited method?
Signup and view all the answers
What are the two kinds of variables in a class?
What are the two kinds of variables in a class?
Signup and view all the answers
What does dynamic binding allow?
What does dynamic binding allow?
Signup and view all the answers
What does an abstract class include?
What does an abstract class include?
Signup and view all the answers
What are the design issues for OOP languages?
What are the design issues for OOP languages?
Signup and view all the answers
What is the relationship of subclasses to their parent class?
What is the relationship of subclasses to their parent class?
Signup and view all the answers
What is a disadvantage of Multiple Inheritance?
What is a disadvantage of Multiple Inheritance?
Signup and view all the answers
Where can object allocation and deallocation occur?
Where can object allocation and deallocation occur?
Signup and view all the answers
What should be considered for efficiency?
What should be considered for efficiency?
Signup and view all the answers
What does an abstract method not include?
What does an abstract method not include?
Signup and view all the answers
What can multiple inheritance allow a new class to inherit from?
What can multiple inheritance allow a new class to inherit from?
Signup and view all the answers
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?
Signup and view all the answers
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?
Signup and view all the answers
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?
Signup and view all the answers
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?
Signup and view all the answers
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?
Signup and view all the answers
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?
Signup and view all the answers
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?
Signup and view all the answers
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?
Signup and view all the answers
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?
Signup and view all the answers
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?
Signup and view all the answers
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?
Signup and view all the answers
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?
Signup and view all the answers
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.