Saturday, February 2, 2013

SAP-ABAP-General-Object-Oriented-Interview-Questions-Answers

SAP-ABAP General Object Oriented Interview Questions Answers, here in this post we are going to provide some frequently asked general object oriented interview questions in SAP OOABAP. Refer this post for more details and interview questions on OOABAP. Click on Read More to read this post.



SAP-ABAP-General-Object-Oriented-Interview-Questions-Answers


SAP-ABAP General Object Oriented Interview Questions Answers, here in this post we are going to provide some frequently asked general object oriented interview questions in SAP OOABAP. Refer this post for more details and interview questions on OOABAP.



1) Can abstract class can only be accessed using its static 
components or its subclasses?

  Yes.


2) What is a single-ton class?

 A class that can be instantiated only once.


3)  What are the differences between Abstract Class and Interface? 

             
            -   Abstract class can not be instantiated; it can be accessed only by
               static component or its  subclass.



                 Interface, which is an independent structure, is used to  
                 implement in a class to extend the scope of a class, it allows 
                 users to address different classes via a universal point of 
                 contact.



4)   Answer the following 
                                                    
a)      An abstract class can be instantiated.

      - No.

b)     Any class containing an abstract method has to be an abstract class

                  -  Yes.

c)      To implement an abstract method in a subclass, one needs to redefine this subclass using the REDEFINITION addition.

      - Yes.


 5)    Answer the following     
                                                                                     
a)      Final classes can have subclasses. 

- No.

b)     A final method cannot be redefined in subclasses

 -  Yes.

c)      All Methods of a final class are inherently final and must not be declared as final in the class definition.

-          Yes.


 6)    What is the purpose of the Read-only addition on the data statement in a class definition?

-    The read only addition is used to define a public attribute with the data statement that can be read from outside the class but can only be changed by methods of class itself.


7)  What is the difference in attributes defined in the public versus private section of a class?

-   Public attributes are accessible by all users of the class. Private attributes can only be accessed   from with in the class itself.


8) What is the keyword used to define static attributes?

-   Class-data is used to define static attributes.


9)  What is the difference in an instance method and a static method?

-  An instance method can be called using an instance and can use both static and instance components in the implementation.


 Syntax: call method instancename->instance-method_name.


An static method can be called using the class and does not require an instance.


Syntax: classname =>class_method_name.


Class methods are similar to instance methods but can only use static components.



10)  What statement is used to instantiate an object?

-          Create object is used to create an instance of a class in memory during runtime, this is also
      referred to as instantiation.



11)  what is the purpose of garbage collector?


-          The garbage collector removes objects from memory and release the memory that no longer have a reference pointing to it.



12)  When is the constructor method is executed?


-          A constructor method is executed only once per instance and is automatically called at runtime, When a create object statement is executed.



13)  Is multiple inheritance is possible in ABAP objects?


  -  No, only single inheritance is supported. Single inheritance means that a subclass can have  one direct superclass.



14) Static methods  can be redefined ? -     

No.


15) A constructor method can be redefined? -   

No.


16) What is a redefined method?


-  A redefined method is a method in a subclass that provides a new definition of inherited method From a superclass in order to provide a more specialized implementation in the subclass.



17) What is a SUPER reference?

-  The reference to super-> in the redefined method is to call the original method of the superclass. 


What are the type casting methods and explain briefly?    


       
      18)  What is class?

-   A class is a template/blueprint based on which all objects of the class are created.


     
      19) What is object? - 

    Object is an instance of a Class.


      20)  Can we instantiate a class within implementation of other class?


             - yes we can instantiate.



      21) What is deferred key word ?


             -  This is used in forward referencing.


                   CLASS class_name DEFINITION DEFERRED.



      22)  Can static method use instance attribute?

      -  No.



       23) Can a method call itself?

       - Yes.


 
       24) What is preferred parameter?


             -  If there are more than one OPTIONAL import parameters in a method and no non-optional import parameters without values, one can type in the clause PREFERRED PARAMETER after the list of import parameters to specify which of the optional parameters will get more preference compared to others when the method will be called using syntax :-


          CALL METHOD objref->meth(<val>).



    25) can we pass returing parameter by reference ?


             -          NO only pass by value.



    26)  What is ME variable?


         -  If an objects internally needs to provide its own reference, it can use the local reference variable “ME”. “ME” is predefined and always contains a reference to the address of its own object.



   27) What are type of constructor and explain them?

     -    Instance constructor and static constructor.


              Instance constructor can only have IMPORTING PARAMETERS & EXCEPTIONS.
        The Static constructor is called automatically when the class is first accessed.


         
   28)  Can we have export parameter in Instance constructor?


      -   It has no EXPORTING parameters because its sole purpose is to initializing the object.



   29)  Can instance constructor raise exception? 

-  Yes it can raise exceptions.



   30)  Can we have static methods in interface? 

-  Yes.





   31) What is interface?



-  Interface is a declaration of a set of methods with no information given about implementation of those methods.  



          
   32) Is it mandatory to implement all the methods of interface?


-  yes. Its mandatory.



          33) What is alias ?


           - Instead of specifying full name of interface methods we can assign it a name which can directly trigger.



 34)  What is Friendship?


        -  With the FRIEND relationship one class can grant another class or interface ( and all classes that implement that interface ) access to its PROTECTED and PRIVATE components.


 35)  Can we have more than one event handler method for same event ?


          -  yes. An event can have multiple event handler method associate with it.


36) Can event have import parameter ?


-  No, The parameter interface for events is limited to EXPORTING parameters, passed by VALUE.


       37)  Can we call static constructor more than once in a program?

       -  Static constructor cannot  be called more than once in a program.


       38)  How can we pass importing parameter ?

      -  pass by value/pass by reference



      39)  Can we implement interface in private section of any class?

 -  No we can’t.


     40)  which of the following are correct ?      

                                                           
a)      Static constructor can’t have interface parameters and can trigger exceptions


b)     Static constructor can have interface parameters and can’t trigger exceptions


c)      Static constructor can have interface parameters and can trigger exceptions


d)     Static constructor can’t have interface parameters and can’t trigger exceptions


   Subclasses of friend and interfaces that receives a friend as a component interface become friend.          


                                                                                            
    41)  Static  attributes are visible in all classes in the inheritance tree . 

- No.


    42)  Can we put non declarative statement e.g. START-OF-SELECTION within a class.


     - No.




Dear ABAPers if you know any other OOABAP Interview Questions please share in below comment box.

"You found the information helpful and want to say thanks? Your donation is enough to inspire us to do more. Thanks a bunch!"

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Categories

ABAP (1) ABAP Interview Questions (112) ABAP Open SQL Statements (1) ABAP Syntax Rules (6) ABAP WORKBENCH (2) ABAP-Interview-Questions (52) ALE IDOC (6) ALE IDOC Interview Questions (6) ale-idoc (6) ALE-IDOC-Interview-Questions (19) ALV Interview Questions (5) ALV-Interview-Questions (22) BADI (2) BAPI (1) BAPI Interview Questions (1) BAPI-Interview-Questions (14) BDC (6) BDC Interview Questions (6) BDC-Interview-Questions (9) big data (2) big data interview questions (1) Classical Reports Interview Question (3) Classical-Reports-Interview-Questions (22) Conditional Statements (1) Cross Applications (3) Cross-Applications (14) Data Dictionary (22) Data Type Questins (1) Data types (1) Data-Dictionary (48) Data-Type-Questins (6) Dialog programming (5) Dialog Programming Interview Questions (4) Dialog-Programming (30) DOMAIN Interview Questions (1) Domain-Interview-Questions (8) Function Module (2) hadoop (2) hadoop interview questions (2) hdfs (1) IDoc Tutorials (6) Interactive Report Interview Questions (4) Interactive-Reports-Interview-Questions (22) Internal Tables (1) interview questions (1) Lock Object Interview Questions (1) Lock-Objects-Interview-Questions (10) Logical Database (1) Modularization Interview Questions (4) Modularization-Interview-Questions (25) Module Pool Programming (5) Module-Pool-Programming (39) modules in sap (1) Object Oriented ABAP (19) Object Oriented ABAP Interview Questions (15) object-oriented-abap (2) Object-Oriented-ABAP-Interview-Questions (34) OOABAP (9) Reports (14) Reports Interview Questions (9) Reports-Interview-Questions (19) RFC (1) RFC Interview Questions (1) RFC-Interview-Questions (14) RICEF (1) RICEF Objects (1) SAP (4) SAP ABAP (4) SAP ABAP Interview Questions (42) SAP ABAP Introduction (46) SAP ABAP Message Types (2) SAP BADI Interview Questions (2) SAP Basics (71) SAP Books (2) SAP Certification (1) SAP CONSULTANTS (5) SAP CRM (1) SAP ENHANCEMENTS (3) SAP EXITS (2) SAP EXITS ( SAP ENHANCEMENTS ) Interview Questions (1) SAP Free Books (1) SAP HR (2) SAP Lock Object (1) sap modules (2) SAP Open SQL Statements (1) SAP R/3 Architecture (4) SAP Search help (1) SAP Smartforms (1) SAP Smartforms Interview Questions (2) SAP Tables (5) SAP Tcodes (10) SAP Views (1) SAP Webdynpro ABAP (12) SAP Work Processors (2) SAP Workflow (3) SAP-BADI-Interview-Questions (11) SAP-Enhancements (39) SAP-Exits (39) SAP-Exits-Enhancements-Interview Questions (3) SAP-HANA (1) SAP-HANA-Interview-Questions (1) SAP-Smartforms-Interview-Questions (2) SAP-Workflow (3) Scripts (3) Scripts Interview Questions (2) Scripts-Interview-Questions (32) Search Help Interview Questions (1) Search-Help-Interview-Questions (9) Smartforms (1) Table Maintenance Generator (1) Table-Maintenance-Generator (4) Tables in SAP (2) Tables Interview Questions (3) Tables-Interview-Questions (3) Type Group Interview Questions (1) Type-Group-Interview-Questions (7) Variable Declaration (1) Views Interview Questions (1) Views-Interview-Questions (5) Webdynpro (12) what is big data (1)

Protected Blog

 
This blog is not affiliated to SAP AG |SAP is trademark of SAP AG |The information collected from various sources use information with your own risk.