Вы находитесь на странице: 1из 12

Page 1 of 12

ABAP OO Quiz
1. What is the Output of this program?

Pick your Answer: A. Syntax Error B. SAPTECHNICAL.COM C. Runtime Error D. No Output The correct answer is: A.

Page 2 of 12

2. What is the Output of this program?

Pick your Answer: A. Syntax Error B. SAPTECHNICAL.COM C. Runtime Error D. No Output The correct answer is: B.

Page 3 of 12

3. What is the Output of this program? CLASS lcl_super DEFINITION. PUBLIC SECTION. CLASS-DATA : w_i TYPE i VALUE '6'. ENDCLASS. "lcl_super DEFINITION START-OF-SELECTION. DATA: w_o1 TYPE REF TO lcl_super. WRITE lcl_super=>w_i.

Pick your Answer: A. Syntax error because of no implementation for class. B. 6 C. Runtime Error D. No Output The correct answer is: B.

4. What is the Output of this program?

Pick your Answer: A. Syntax error B. 6

Page 4 of 12

C. Runtime Error D. No Output The correct answer is: A.

Page 5 of 12

5. What is the Output of this program?

Pick your Answer: A. Syntax error B. 5 C. Runtime Error D. No Output The correct answer is: A.

Page 6 of 12

6. What is the Output of this program?

Pick your Answer: A. Syntax error B. 5 C. Runtime Error D. No Output The correct answer is: B.

Page 7 of 12

7. What is the Output of this program?

Pick your Answer: A. Syntax error B. 10 C. Runtime Error D. No Output The correct answer is: A.

Page 8 of 12

8. What is the Output of this program?

Pick your Answer: A. Syntax error B. 5 C. Runtime Error D. No Output The correct answer is: B.

Page 9 of 12

9. What is the Output of this program? CLASS c1 DEFINITION. PUBLIC SECTION. DATA: w_v1 TYPE i. METHODS: w_m1 . ENDCLASS. "c1 DEFINITION CLASS c1 IMPLEMENTATION. METHOD w_m1. WRITE :/ 'Method m1 in Class c1'. ENDMETHOD. "w_m1 ENDCLASS. "c1 IMPLEMENTATION CLASS c2 DEFINITION INHERITING FROM c1. PUBLIC SECTION. DATA: w_v2 TYPE i. METHODS: w_m2 . ENDCLASS. "c2 DEFINITION CLASS c2 IMPLEMENTATION. METHOD w_m2. WRITE :/ 'Method m2 in Class c2'. ENDMETHOD. "w_v2 ENDCLASS. "c2 IMPLEMENTATION CLASS c3 DEFINITION INHERITING FROM c2. PUBLIC SECTION. DATA: w_v3 TYPE i. METHODS: w_m3 . ENDCLASS. "c2 DEFINITION CLASS c3 IMPLEMENTATION. METHOD w_m3. WRITE :/ 'Method m3 in Class c3'. ENDMETHOD. "w_v2 ENDCLASS. "c2 IMPLEMENTATION DATA: w_o1 TYPE REF TO c1, w_o3 TYPE REF TO c3. START-OF-SELECTION. CREATE OBJECT w_o3. w_o1 = w_o3. CALL METHOD w_o1->w_m1.

Page 10 of 12
CALL METHOD w_o1->w_m2. CALL METHOD w_o1->w_m3.

Pick your Answer: A. Syntax error B. Method m1 in Class c1 Method m2 in Class c2 Method m3 in Class c3 C. Runtime Error D. No Output The correct answer is: A.

Page 11 of 12

10. What is the Output of this program? CLASS c1 DEFINITION. PUBLIC SECTION. DATA: w_v1 TYPE i. METHODS: w_m1 . ENDCLASS. "c1 DEFINITION CLASS c1 IMPLEMENTATION. METHOD w_m1. WRITE :/ 'Method m1 in Class c1'. ENDMETHOD. "w_m1 ENDCLASS. "c1 IMPLEMENTATION CLASS c2 DEFINITION INHERITING FROM c1. PUBLIC SECTION. DATA: w_v2 TYPE i. METHODS: w_m2 . ENDCLASS. "c2 DEFINITION CLASS c2 IMPLEMENTATION. METHOD w_m2. WRITE :/ 'Method m2 in Class c2'. ENDMETHOD. "w_v2 ENDCLASS. "c2 IMPLEMENTATION CLASS c3 DEFINITION INHERITING FROM c2. PUBLIC SECTION. DATA: w_v3 TYPE i. METHODS: w_m3 . ENDCLASS. "c2 DEFINITION CLASS c3 IMPLEMENTATION. METHOD w_m3. WRITE :/ 'Method m3 in Class c3'. ENDMETHOD. "w_v2 ENDCLASS. "c2 IMPLEMENTATION DATA: w_o3 TYPE REF TO c3. START-OF-SELECTION. CREATE OBJECT w_o3. CALL METHOD w_o3->w_m1. CALL METHOD w_o3->w_m2. CALL METHOD w_o3->w_m3.

Page 12 of 12

Pick your Answer: A. Syntax error B. Method m1 in Class c1 Method m2 in Class c2 Method m3 in Class c3 C. Runtime Error D. No Output The correct answer is: B.

Вам также может понравиться