Questions
ayuda
option
My Daypo

ERASED TEST, YOU MAY BE INTERESTED ONABAP 7.4 - Chapter 17 - Class Identification Analysis

COMMENTS STATISTICS RECORDS
TAKE THE TEST
Title of test:
ABAP 7.4 - Chapter 17 - Class Identification Analysis

Description:
Class Identification Analysis and Design

Author:
ONKIDONKI
(Other tests from this author)

Creation Date:
30/04/2017

Category:
Others

Number of questions: 21
Share the Test:
Facebook
Twitter
Whatsapp
Share the Test:
Facebook
Twitter
Whatsapp
Last comments
No comments about this test.
Content:
What is correct to say about Functional Methods: (There are four correct answers) Methods that have a RETURNING parameter are described as functional methods The RETURNING parameter must always be passed by value There are no limits of RETURNING parameters that can be defined for a method The advantage of functional methods is that they do not require the use of temporary variables because they can be used in conjunction with other statements Functional methods can be used in: Logical expressions (IF, ELSEIF, WHILE, CHECK, WAIT) , Case conditions (CASE, WHEN) , Arithmetic expressions and bit expressions (COMPUTE) , Sources of values as a local copy (MOVE) , Search clauses for internal tables, assuming that the operand is not a component of the table row (LOOP AT ... WHERE).
What is correct to say about Static Methods: (There are three correct answers) static methods are defined at the class level The restriction that only static components can be accessed in a static method applies to the implementation of the method static methods are addressed with their class name because they do not need instances Unlike the instance methods, when you call a static method from within the class, you cannot omit the classname.
What is correct to say about Singletons: (There are three correct answers) Used to ensure that a class will be instantiated more than once A singleton is a class that is final It has a private instantiation level instantiated using its static constructor (which is executed only after the first time the class is accessed in an application).
What is correct to say about Friendship: (There are four correct answers) In rare cases, classes have to work together so closely that they need access to each other’s protected or private components. This can be achieved if one class grants friendship to another The concept of friendship between classes prevents these components from being made available to all applications, but the friend can access the protected and private components directly A class can grant friendship to other classes and interfaces The primary reason for friendship are the OO conventions To grant friendship, use the INTERFACES addition of the CLASS statement or the Friends tab in the Class Builder Granting friendship is one-sided; a class that grants friendship is not automatically a friend of its friends. If the class that grants friendship wants to access nonpublic components of the friend, this friend must reciprocate and explicitly grant friendship back to the original class.
What is correct to say about Inheritance: (There are five correct answers) Specialization is a relationship in which one class (the subclass) inherits all of the components of another class (the superclass) It is possible for the subclass to add new components and replace the implementations of inherited methods Common components are extracted and defined once in the superclass, allowing for central maintenance and eliminating redundant implementation Subclasses contain extensions and/or changes Superclasses are dependent on subclasses You therefore need to be careful if you make changes to the superclass, because they will directly affect the subclasses inheriting from it and when using the Refactoring Assistant Like other languages, there is multiple inheritance in ABAP Objects.
What is correct to say about Redefinition: (There are four correct answers): Redefinition allows you to change the implementation of an inherited instance method in a subclass without changing the signature It is therefore not possible to use redefinition within the PRIVATE SECTION The superclass cannot be defined as Final Unlike the instance constructor, the static constructor in the superclass is always called automatically.The runtime system automatically ensures that the static constructors of all superclasses have been executed before the static constructor in a particular class is executed Overloading, which allows a method to have several definitions with different signatures and thus also different implementations, is also supported in ABAP Objects.
What is correct to say about Visibility: (There are four correct answers) When you use inheritance, another visibility section can be useful: the PROTECTED SECTION The protected component’s visibility is between public and private and is visible to all subclasses and the class itself, but it is still protected from outside the inheritance tree. When you define local classes in ABAP, you must follow the syntactical sequence of PRIVATE SECTION, PROTECTED SECTION, and PUBLIC SECTION The sequencing for a global class is handled automatically You can address the private components directly in the syntax of the subclass All subclasses share a public or protected static attribute of the superclass You can also redefine static methods.
What is correct to say about Casting: (There are five correct answers) By assigning a subclass reference to a superclass reference, all components that can be accessed syntactically after the cast assignment are actually available in the instance. You typically use a down cast assignment to prepare for generic access If the class did not redefine the method, the implementation from the superclass is executed instead When objects from different classes react differently to the same method calls, this is known as aggregation To assign a superclass reference to a subclass reference, you must use the down cast assignment operator MOVE ... ?TO ... or its short form ?= . Example: lr_manager ?=lr_person A down cast can only be performed after first doing an up cast. Because the target variable can accept fewer dynamic types after the assignment, this assignment is also called narrowing cast You typically use up cast assignments when specific components of instances need to be addressed, and their references are kept in variables that are typed on the superclass (for example, a generic list of objects). You can catch an exception using the exception class CX_SY_MOVE_CAST_ERROR.
What is correct to say about Interfaces: (There are four correct answers) Interfaces can also be instantiated and only have public components Interfaces allow you to define uniform interfaces (protocols) for methods Different classes that include the interface can therefore implement these methods in different ways but keep the same semantics You distinguish interface components from other components in the implementing class by prefixing the interface name followed by a $, which is the interface resolution operator To simplify access to interface components, you can use alias names. These can only appear in the definition part of a class or in the interface definition, and their use is subject to the visibility restriction of the defining class You can only access interface components by using an object reference whose class implements the interface.
The Refactoring Assistant allows you to move components between superclasses and subclasses or between classes and interfaces (for example, if you have defined a component in a class and then realize that component should belong in the superclass instead). True False.
Given the code in the exhibit and the knowledge that both lcl_truck and lcl_car inherit from lcl_vehicle, which statements are true? Select all that apply. (There are three correct answers) The code is not syntactically correct The table lt_vehicle contains three vehicles The code will produce a runtime error The code shows three valid up casts The code shows two valid up casts The code shows no valid up casts.
What is unique about a singleton? Select all that apply (There are two correct answers) It must be instantiated using a private instance constructor It must be instantiated using a public instance constructor It must be instantiated using a protected instance constructor It must be instantiated using a static private constructor It must be instantiated using a static public constructor It must be instantiated using a static protected constructor It must be defined as FINAL It cannot be defined as FINAL.
Which statements are true about a class that has granted friendship to another class? Select all that apply (There are four correct answers) The friend has access to private attributes The friend has access to protected attributes The friend has access to public attributes All classes the friend has granted friendship access status to also have the same access All classes that inherit from the friend (subclasses) also have the same access.
There can only be one level in the inheritance tree: True False.
Which statements are true regarding ABAP inheritance? Select all that apply. (There are four correct answers) You can access the superclass component with the prefix SUPER-> The instance constructor can be overwritten as part of inheritance The static constructor can be overwritten as part of inheritance Overloading allows a method to have several definitions with different signatures Instance constructors must call the superclass’s constructor Static constructors do not need to call the superclass’s constructor Polymorphism requires the developer to specify which method to use with inheritance.
Which statements are considered obsolete and cannot be used in ABAP Objects? Select all that apply TABLES DATA ... TYPE ... OCCURS DATA ... BEGIN OF ... OCCURS INFOTYPES RANGES LEAVE ON CHANGE OF SEARCH LOOP AT dbtab.
With what can you simulate multiple inheritance: REDEFINITION INHERITING FROM INTERFACES.
What is unique about a functional method? Select all that apply. It must contain a returning parameter It can contain an importing parameter It can contain an exporting parameter It can contain a changing parameter It can be used in logical expressions It can be used in SELECT statements It must be a singleton.
When you define local classes in ABAP, which syntactical sequence must you follow? PUBLIC SECTION, PROTECTED SECTION, PRIVATE SECTION PRIVATE SECTION, PROTECTED SECTION, PUBLIC SECTION The order doesn’t matter The order is handled automatically.
What does the Refactoring Assistant allow you to do? Select all that apply. Move components between superclasses and subclasses Rename all occurrences of a method Move between classes and interfaces.
ABAP now has predefined functions that behave like functional methods True False.
Report abuse Consent Terms of use