Home / C# Programming / Inheritance :: Discussion

Discussion :: Inheritance

  1. What will be the size of the object created by the following C#.NET code snippet?

     namespace FresherGateConsoleApplication
     {   
        class Baseclass  
        {      
           private int i;   
           protected int j;    
           public int k;   
        }     
        class Derived: Baseclass    
        {   
          private int x;   
          protected int y;  
          public int z;  
       }
       class MyProgram  
       {     
          static void Main (string[ ] args)  
          {     
             Derived d = new Derived();  
          }  
       
         }  
      }
    

  2. A.

    24 bytes

    B.

    12 bytes

    C.

    20 bytes

    D.

    10 bytes

    E.

    16 bytes

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    No answer description available for this question.


Be The First To Comment