Taw10 -week 2

59 Questions | Attempts: 933
Share

SettingsSettingsSettings
SAP Quizzes & Trivia

For preparation for SAP ABAP certification. This was taken from another website ( http://www. Esnips. Com/doc/69f7a006-bef6-474e-97b7-35e9dae6af72/TAW10-2- 2-Objetos or http://www. Scribd. Com/doc/6912147/TAW10-22-Objetos ) where the answers were already provided.


Questions and Answers
  • 1. 

    A program needs to gain access to the public attributes of class lcl_course.  Identify the statements that are valid. class lcl_course definition.  public section.    data: name(15) type c value 'ABAPObjects101'.    class-data price type p value 100.   private section.    data: category(10) type C value 'Objects'. endclass. data: course1 type ref to lcl_course,      course_name type string,      course_price type p,      course_category type string. **INSTANTIATION OMITTED **

    • A.

      Course_name = name

    • B.

      Name can not be accessed unless course1 is instantiated

    • C.

      Course_name = course1=>name

    • D.

      Course_name = course1->name

    • E.

      Course_price = lcl_course=>price

    Correct Answer(s)
    B. Name can not be accessed unless course1 is instantiated
    E. Course_price = lcl_course=>price
  • 2. 

    The concept of restricting direct access to data via hidden internal processes is best represented by which term?

    • A.

      Instantiation

    • B.

      Encapsulation

    • C.

      Inheritance

    • D.

      Polymorphism

    Correct Answer
    B. Encapsulation
  • 3. 

    A syntax for instance method specification is

    • A.

      Call method Objref=>method

    • B.

      Call Method->Objref

    • C.

      Call Method (from within another instance method)

    • D.

      Call method Objref->method

    Correct Answer(s)
    C. Call Method (from within another instance method)
    D. Call method Objref->method
  • 4. 

    What syntax provides access to individual components of a class within the class

    • A.

      CALL METHOD object instance->ME->

    • B.

      ME->

    • C.

      CALL METHOD ME->

    • D.

      Object instance->ME

    Correct Answer(s)
    B. ME->
    C. CALL METHOD ME->
  • 5. 

    Identify the ABAP OO Event signature protocols

    • A.

      Events can only have exporting Parameters

    • B.

      Exporting paramets can only be passed by reference

    • C.

      Exporting parameters can only be passed by value

    • D.

      Events can only have importing Parameters

    Correct Answer(s)
    A. Events can only have exporting Parameters
    C. Exporting parameters can only be passed by value
  • 6. 

    Mark the item that is NOT true about the handler table

    • A.

      Event handler methods are called in the sequence that they were registered in the handler table

    • B.

      There is a separate handler table for every object that has defined events

    • C.

      Registered Methods in the handler table can only be triggered by RAISE EVENT i.e. not by CALL METHOD

    • D.

      A single SET Handler command can be used to register multiple handler methods in the handler table

    Correct Answer
    C. Registered Methods in the handler table can only be triggered by RAISE EVENT i.e. not by CALL METHOD
  • 7. 

    In the following method, what other parameters are allowed CLASS lcl_course DEFINITION.  PUBLIC SECTION.    METHODS: get_course_name                IMPORTING im_name type string                Returning value(student_count) type I .ENDCLASS.

    • A.

      Exceptions

    • B.

      Exporting

    • C.

      Changing

    • D.

      Receiving

    Correct Answer
    A. Exceptions
  • 8. 

    What implications exists when private components of a class are changed

    • A.

      Users of the private components must change their interface

    • B.

      Any programs accessing the class must also change

    • C.

      Programs are insulated from change

    • D.

      None of the answers are correct

    Correct Answer
    C. Programs are insulated from change
  • 9. 

    Finish the following sentence so that it is TRUE.Static Components in an inheritance relationship....

    • A.

      Does not allow for methods to be redefined in subclasses

    • B.

      Cannot be shared

    • C.

      Exist once per roll area

    • D.

      Receive their own copy of the static attribute for each subclass

    Correct Answer(s)
    A. Does not allow for methods to be redefined in subclasses
    C. Exist once per roll area
  • 10. 

    In the context of Triggering and Handling of Events, mark those which apply

    • A.

      Events can be triggered with the "Trigger Event" command

    • B.

      Methods must be registered to an event in order to be called when the event is triggered

    • C.

      An event is defined in the Implementation of a Class

    • D.

      Event Triggering using "Raise Event" can be issued in a method

    Correct Answer(s)
    B. Methods must be registered to an event in order to be called when the event is triggered
    D. Event Triggering using "Raise Event" can be issued in a method
  • 11. 

    An inherited class:

    • A.

      Can remove superclass components

    • B.

      Can add components over and above the superclass

    • C.

      Can access the inherited private components

    • D.

      Can redefine the public methods of the superclass

    • E.

      Cannot access the protected components

    Correct Answer(s)
    B. Can add components over and above the superclass
    D. Can redefine the public methods of the superclass
  • 12. 

    What is contained in a class that does not exist in an interface

    • A.

      Implementation

    • B.

      Attributes

    • C.

      Method

    • D.

      Definition

    Correct Answer
    A. Implementation
  • 13. 

    How can a program access private attributes of an object

    • A.

      By methods of a different object within the same program

    • B.

      Only by methods of the specific object itself

    • C.

      By methods of a different instance of the same object

    • D.

      From outside the class

    Correct Answer
    B. Only by methods of the specific object itself
  • 14. 

    A public attribute 'color' is added to a superclass.  A subclass already has the same attribute 'color'  What is the outcome?

    • A.

      The sublass is invalidated.

    • B.

      A syntax message will occur

    • C.

      The superclass is invalidated

    • D.

      A runtime error will occur

    Correct Answer(s)
    A. The sublass is invalidated.
    B. A syntax message will occur
  • 15. 

    Select the term used for Classes that can implement the same method differently

    • A.

      Polymorphism

    • B.

      Inheritance

    • C.

      Encapsulation

    • D.

      Casting

    • E.

      Instantiation

    Correct Answer
    A. Polymorphism
  • 16. 

    What are the rules for Event parameters

    • A.

      EXPORTING Parameters for events can only be passed by value

    • B.

      EXPORTING Parameters for events can only be passed by reference

    • C.

      Events can only have EXPORTING parameters

    • D.

      Events also allow RETURNING parameters

    Correct Answer(s)
    A. EXPORTING Parameters for events can only be passed by value
    D. Events also allow RETURNING parameters
  • 17. 

    When redefining methods in a subclass, what is allowed ?

    • A.

      Code can be changed

    • B.

      Only Instance methods

    • C.

      Signature can be changed

    • D.

      Private Static methods

    Correct Answer(s)
    A. Code can be changed
    B. Only Instance methods
  • 18. 

    Define Polymorphism

    • A.

      It’s a characteristic when methods of the same class react differently to the same method call

    • B.

      It’s one of the main strengths of inheritance

    • C.

      It’s a characteristic when methods from different classes react differently to the same interface

    • D.

      The same method is implemented in different ways by redefining the method in subclasses

    • E.

      It’s a characteristic when objects from different classes react differently to the same method call

    Correct Answer(s)
    B. It’s one of the main strengths of inheritance
    D. The same method is implemented in different ways by redefining the method in subclasses
    E. It’s a characteristic when objects from different classes react differently to the same method call
  • 19. 

    Where are the methods of a class implemented

    • A.

      Object instantiation part of a program

    • B.

      Implementation part of a class

    • C.

      Definition part of Class

    • D.

      Call method of the Class

    Correct Answer
    B. Implementation part of a class
  • 20. 

    Your program has registered several handler methods.  How does the program know what methods are available for execution when an event is triggered.

    • A.

      The system looks for registered handler methods In the registry table and processes those that are registered for the event

    • B.

      The system looks for registered handler methods In the event handler internal table and processes those that are registered for the event

    • C.

      The methods defined in the Class Definition listen for raised events and respond when an event is triggered

    • D.

      It is determined by the RAISE Event command

    Correct Answer
    B. The system looks for registered handler methods In the event handler internal table and processes those that are registered for the event
  • 21. 

    A program needs to gain access to the public attributes of calss lcl_course.  Identify the statements that are valid. class lcl_course definition.   public section.    data: name(15) type c value 'ABAPObjects101'.    class-data price type p value 100.   private section.    data: category(10) type C value 'Objects'. endclass. data: course1 type ref to lcl_course,      course_name type string,      course_price type p,      course_category type string. Create Object course1.

    • A.

      Course_price = lcl_course=>price

    • B.

      Course_name = course1->name

    • C.

      Course_name = course1=>name.

    • D.

      Course_name = name

    • E.

      Course_price = lcl_course->price

    Correct Answer(s)
    A. Course_price = lcl_course=>price
    B. Course_name = course1->name
  • 22. 

    Class A provides friendship to Class B.  Class B provides friendship to Class C.  Identify the valid friend relationship.

    • A.

      C is a friend of A

    • B.

      C is friend of B

    • C.

      A is friend of B and C

    • D.

      B and C are friends of A

    • E.

      B is friend of A

    Correct Answer(s)
    B. C is friend of B
    E. B is friend of A
  • 23. 

    Pick the syntax for a funtional method with only 1 parameter

    • A.

      Refvar->method returning()

    • B.

      Refvar->method(p1)

    • C.

      Refvar->method(im = p1)

    • D.

      Refvar->method receiving()

    Correct Answer(s)
    B. Refvar->method(p1)
    C. Refvar->method(im = p1)
  • 24. 

    In object orientation, the term USER includes

    • A.

      Events

    • B.

      Methods

    • C.

      Attributes

    • D.

      All of the answers are correct

    • E.

      None of the answers are correct

    Correct Answer
    D. All of the answers are correct
  • 25. 

    Initializing an object in a subclass requires that the constructor of the superclass is first called.  Identify the correct syntax.

    • A.

      Call Method Super Constructor

    • B.

      Call Method Super->Constructor

    • C.

      Call Method Constructor

    • D.

      Call Method Constructor->Super

    Correct Answer
    B. Call Method Super->Constructor
  • 26. 

    Identify the valid statements that will write out the Static Attributes in the following code: class lcl_course definition.   public section.    data: name(15) type c value 'ABAPObjects101'.    class-data price type p value 100.   private section.    data: category(10) type C value 'Objects'. endclass. data: course1 type ref to lcl_course,      course_name type string,      course_price type p,      course_category type string.

    • A.

      Course_price = lcl_course=>price. Write course_price.

    • B.

      Write: price.

    • C.

      Write lcl_course=>price.

    • D.

      Write lcl_course->price

    Correct Answer
    A. Course_price = lcl_course=>price. Write course_price.
  • 27. 

    The syntax for static method specification

    • A.

      Call method class name->method

    • B.

      Call method class name=>method

    • C.

      Call class-method

    • D.

      Call Method->class name

    Correct Answer
    B. Call method class name=>method
  • 28. 

    What triggers an event

    • A.

      Raise Event inside the Method

    • B.

      Call Method

    • C.

      None of the answers are correct

    • D.

      Raise Event

    • E.

      All answers are correct

    Correct Answer
    E. All answers are correct
  • 29. 

    What can be said about the visibility of attributes in the following code: CLASS lcl_course DEFINITION.    PUBLIC SECTION.    Data: name type string.   PRIVATE SECTION.    Data: price type course-price. ENDCLASS.

    • A.

      Price is protected from outside access

    • B.

      Price is available to methods inside the class

    • C.

      Name is available to methods only inside the class

    • D.

      Name is protected from outside access

    Correct Answer(s)
    A. Price is protected from outside access
    B. Price is available to methods inside the class
  • 30. 

    Mark the operator used to widen cast of a class

    • A.

      =>

    • B.

      =?

    • C.

      ->

    • D.

      ?=

    • E.

      =

    Correct Answer
    D. ?=
  • 31. 

    Identify the statements that best describe the visibility of classes

    • A.

      Local Classes are available only to the program where the class is defined

    • B.

      Global classes are centrally available to all ABAP programs

    • C.

      Local Classes are available only to programs in the same development class

    • D.

      Global Classes are available only from programs belonging to the same development class

    Correct Answer(s)
    A. Local Classes are available only to the program where the class is defined
    B. Global classes are centrally available to all ABAP programs
  • 32. 

    Changing the view of an instance of a class with more details is referred to as

    • A.

      Narrowing cast

    • B.

      Up cast

    • C.

      Widening cast

    • D.

      Dynamic referencing

    Correct Answer
    C. Widening cast
  • 33. 

    What happens when the Set handler command is executed

    • A.

      An instance of the event is created

    • B.

      The Event Handler Method is registered

    • C.

      The Event is triggered

    • D.

      The Event is handled

    Correct Answer
    B. The Event Handler Method is registered
  • 34. 

    Mark the items that characterize the Methods of a Class

    • A.

      Can change the state of an object

    • B.

      Can access only public attributres in their class

    • C.

      Can access all atributes in their class

    • D.

      Can be defined with a parameter interface

    • E.

      Only pass return codes to the calling program

    Correct Answer(s)
    A. Can change the state of an object
    C. Can access all atributes in their class
    D. Can be defined with a parameter interface
  • 35. 

    Refer to the following code and indicate which statements are true: Data: cl_container type ref to cl_gui_custom_container,      cl_grid type ref to cl_gui_alv_grid.

    • A.

      Cl_grid points to the object that communicates with the ALV grid control

    • B.

      Cl_grid points to the object that communicates with the container control

    • C.

      Cl_container points to the object that communicates with the ALV grid control

    • D.

      Cl_container points to the object that communicates with the container control

    Correct Answer(s)
    A. Cl_grid points to the object that communicates with the ALV grid control
    D. Cl_container points to the object that communicates with the container control
  • 36. 

    Local Class lcl_course has been defined in program belonging to development class ZCL.  What is the key entry in the repository table TADIR

    • A.

      R3TR CLASS

    • B.

      R3TR LOCAL CLASS

    • C.

      None of the answers are correct

    • D.

      R3TR ZCL CLASS

    • E.

      R3TR lcl_class

    Correct Answer
    C. None of the answers are correct
  • 37. 

    A MOVE_CAST_ERROR runtime error just occurred.  Identify the cause

    • A.

      Super class and subclass both point to an instance of the same class type

    • B.

      Casting a super class to a subclass when superclass does not point to an instance of the subclass type

    • C.

      Subclass reference variable corresponds to the superclass reference variable

    • D.

      Super class method is called from the subclass

    Correct Answer
    B. Casting a super class to a subclass when superclass does not point to an instance of the subclass type
  • 38. 

    Refer to the following code and select the VALID method call: Class lcl_course definition.   Public section.    data: course_name(12) type c.    methods: display_price              importing im_course_name type string.   Private section.    Data: price type P value 100.    constants: c_objects101(10) type c value 'OBJECTS101'. endclass. class lcl_course implementation.   method display_price.    course_name = im_course_name.    If course_name = c_objects101.      Write: price.    Endif.  endmethod. endclass. Data obj_course type ref to lcl_course. start-of-selection. create object obj_course.

    • A.

      Call method obj_course->display_price exporting im_course_name = 'OBJECTS101'.

    • B.

      Call method obj_course->display_price importing im_course_name = 'OBJECTS101'.

    • C.

      Call method obj_course->display_price exporting course_name = 'OBJECTS101'.

    • D.

      Call method obj_course->display_price exporting im_course_name = c_objects101.

    Correct Answer
    A. Call method obj_course->display_price exporting im_course_name = 'OBJECTS101'.
  • 39. 

    Using example code below, choose the correct syntax for the redefined method: Class lcl_car definition.   Public Section.    method calc_speed importing im_distance type ty_dist. End Class.

    • A.

      Method calc_speed importing im_distance.

    • B.

      Method calc_speed Redefinition.

    • C.

      Method calc_speed importing im_distance Redefinition

    • D.

      Method calc_speed Redefinition importing im_distance type ty_dist.

    Correct Answer
    B. Method calc_speed Redefinition.
  • 40. 

    What can be said about the lifetime of an object

    • A.

      All answers are correct

    • B.

      An object exists for as long as it is being used in the program

    • C.

      An object exists for as long as at least one reference points to it

    • D.

      An object exists as long as at least one method of the object is registered as an event handler.

    Correct Answer
    A. All answers are correct
  • 41. 

    Global Class cl_course has been defined using the class builder.  The development class is ZCL.  What is the key entry in the repository table TADIR.

    • A.

      R3TR ZCL CLASS

    • B.

      None of the answers are correct

    • C.

      R3TR CLAS cl_course

    • D.

      R3TR cl_course

    • E.

      R3TR GLOB CLASS

    Correct Answer
    C. R3TR CLAS cl_course
  • 42. 

    What statement will request memory to be allocated to an object

    • A.

      Call Constructor

    • B.

      Create Object

    • C.

      Call Method

    • D.

      Create Constructor

    Correct Answer
    B. Create Object
  • 43. 

    Refer to the following code and identify the statements that are TRUE. CLASS lcl_course DEFINITION.  PUBLIC SECTION.    METHODS: get_course_name IMPORTING im_name type string.    CLASS-METHODS: list_prices_and_discounts.ENDCLASS. CLASS lcl_course IMPLEMENTATION.  METHOD get_course_name.  ENDMETHOD.   METHOD list_prices_and_discounts.  ENDMETHOD.ENDCLASS. Data: course1 type ref to lcl_course,      course2 type ref to lcl_course. Start-of-selection. Create object course1.Course2 = course1.

    • A.

      Method list_prices_and_discounts is a static method

    • B.

      Method list_prices_and_discounts can only be called once

    • C.

      List_prices_and_discounts is a instance method

    • D.

      Only one instance of method get_course_name exists

    • E.

      Only one instance of method list_prices_and_discounts exists

    Correct Answer(s)
    A. Method list_prices_and_discounts is a static method
    E. Only one instance of method list_prices_and_discounts exists
  • 44. 

    Identify the Characteristics of a Final Class

    • A.

      No answers are correct

    • B.

      All answers are correct

    • C.

      Methods cannot be explicitly designated as FINAL

    • D.

      Contains final methods implicitly

    • E.

      Cannot have subclasses

    Correct Answer
    B. All answers are correct
  • 45. 

    Using the UML modeling language for ABAP OO design, refer to the following and indicate the visibility of the components -------------------| cl_myclass      |-------------------| +city           || #address        ||-----------------|| + get_city()    || - display_addr()||                 ||-----------------|

    • A.

      Get_city is a public attribute

    • B.

      Address is protected attribute

    • C.

      Display_address is a public method

    • D.

      Display_address is a static public method

    • E.

      Display_address is a private method

    Correct Answer(s)
    B. Address is protected attribute
    E. Display_address is a private method
  • 46. 

    What is possible with a subclass in an inheritance relationship to the superclass

    • A.

      The subclass can remove components of the superclass

    • B.

      Can add new components to the subclass

    • C.

      Can provide inherited methods with new implementations (redefinition)

    • D.

      Inherits all the characteristics of the superclass

    • E.

      Components defined in the superclass are not present in the subclass unless they are explicitly defined in the definition of the subclass

    Correct Answer(s)
    B. Can add new components to the subclass
    C. Can provide inherited methods with new implementations (redefinition)
    D. Inherits all the characteristics of the superclass
  • 47. 

    In the context of polymorphism and interfaces, mark the item that is NOT true

    • A.

      The user is protected from the actual implementations

    • B.

      Interfaces describe the point of contact of a class

    • C.

      Interfaces contain their own implementation part

    • D.

      A class can implement any number of interfaces

    Correct Answer
    C. Interfaces contain their own implementation part
  • 48. 

    Select the answers that apply to static methods and instance methods

    • A.

      Instance methods MUST be addressed by object ref after instantiation

    • B.

      Static methods MUST be addressed by object reference after instantiation

    • C.

      Instance methods MUST be addressed class name

    • D.

      Static methods MUST be addressed by class_name even when object in instantiated

    Correct Answer(s)
    A. Instance methods MUST be addressed by object ref after instantiation
    D. Static methods MUST be addressed by class_name even when object in instantiated
  • 49. 

    Identify the valid rule when calling public methods from within the class

    • A.

      When calling a static method, the class name is required

    • B.

      When calling an instance method, the => operator is required

    • C.

      When calling a static method, the class name can be omitted

    • D.

      Private methods can not call public methods

    Correct Answer
    C. When calling a static method, the class name can be omitted
  • 50. 

    Where is the visibility of class components defined

    • A.

      Object Instance

    • B.

      Class Methods

    • C.

      Class Implementation

    • D.

      Class Definition

    Correct Answer
    D. Class Definition

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Jan 03, 2013
    Quiz Edited by
    ProProfs Editorial Team
  • Aug 10, 2009
    Quiz Created by
    Newtonskn
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.