Examveda

What will be size of the object created depicted by C# code snippet?
class baseclass
{
    private int a;
    protected int b;
    public int c;
}
class derived : baseclass
{
    private int x;
    protected int y;
    public int z;
}
class Program
{
    static Void Main(string[] args)
    {
        derived a = new derived();
    }
}

A. 20 bytes

B. 12 bytes

C. 16 bytes

D. 24 bytes

Answer: Option D


Join The Discussion

Related Questions on Classes and Objects in C Sharp