Select chapter

Basics (2.papers)
Data Types (2.papers)
enums (2.papers)
OOPS (4.papers)
Arrays (1.papers)
Structs (2.papers)
Properties (2.papers)
Strings (2.papers)
Interfaces (1.papers)
Constructors (2.papers)
Ref-Out-Keywords (1.papers)
Collections (2.papers)
Generics (1.papers)


c# constructors interview questions and answers

What is the output of the following code?
public class A
    public A(int x)  {   }
public class B:A
    public B(int y) {  }
  1. Code will not compile because class B is not having any fields or data members.
  2. Code will not compile because derived class constructor can not call base class constructor.
  3. Code will compile but exception while creating the object of class B.
  4. None of the options are correct.
Show Answer
Share Facebook gmail Twitter
Read more papers :