ADVANCED TOPICS IN COMPILER DESIGN
CODE GENERATION FOR OBJECT ORIENTED LANGUAGES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Public methods in A are accessible in B and can be overloaded by other methods in B
|
|
Public methods in A are accessible in B and can be overridden by other methods in B.
|
|
Public methods in B are accessible in A and can be overloaded by other methods in A.
|
|
Public methods in B are accessible in A and can be overridden by other methods in A.
|
Detailed explanation-1: -The correct answers are: Abstract classes are general and may contain methods without any particular implementation. OOP improves debugging and testing as the object definition is contained in one place. OOP promotes code reuse.
Detailed explanation-2: -The correct answer is E. All of the statements are true in object-oriented programming. Classes provide the blueprint of objects to be created while interfaces provide contracts for the classes implementing them. Class attributes represent the state of the object created at any particular time.
Detailed explanation-3: -Significant object-oriented languages include: Ada, ActionScript, C++, Common Lisp, C#, Dart, Eiffel, Fortran 2003, Haxe, Java, JavaScript, Kotlin, logo, MATLAB, Objective-C, Object Pascal, Perl, PHP, Python, R, Raku, Ruby, Scala, SIMSCRIPT, Simula, Smalltalk, Swift, Vala and Visual Basic.NET.
Detailed explanation-4: -9) Which of the following statements is correct regarding the object-oriented programming concept in Python? 10) Which of the following statements is correct in this python code? Explanation: “name1” and “name2” refer to the same object, so id(name1) and id(name2) will have the same value.