Skip to content

Instantly share code, notes, and snippets.

@supreettare
Last active November 26, 2019 15:46
Show Gist options
  • Select an option

  • Save supreettare/045ea23b995662061f2d6bcee34900e0 to your computer and use it in GitHub Desktop.

Select an option

Save supreettare/045ea23b995662061f2d6bcee34900e0 to your computer and use it in GitHub Desktop.
class Taritas
{
static void Main(string[] args)
{
Y bObj= new Y(2);
Console.ReadLine();
}
}
public class X
{
public X()
{
Console.WriteLine("Hi you are in class X");
}
public X(int x)
{
}
}
public class Y:X
{
public Y()
{
Console.WriteLine("Hi you are in class Y");
}
}
@nitinkumar2
Copy link

Error : we cannot pass value in Y bObj = new Y(2);

@saprevarun
Copy link

we cannot pass value in Y bib=new Y(2);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment