Analyse the code

public class A
{
 public AA void x() { }
 public BB int y
 {
 get { return 0; }
 }
}
public class B : A
{
 public override void x() { }
 public override int y
 {
 get { return 0; }
 }
}

What can be used in place of AA and BB in the above given C# code snippet so that the overriding mentioned in Class B can be achieved?

1. AA-> virtual BB-> virtual

2. AA-> friend BB-> abstract

3. AA-> abstract BB-> virtual

4. AA-> friend BB-> virtual

5. AA-> virtual BB-> abstract

6. AA-> abstract BB-> abstract

Options
  1. Either 1 or 2
  2. Either 1 or 3 or 5 or 6
  3. Either 2 or 3 or 4 or 5
  4. Either 2 or 4
  5. Either 1 or 3 or 4

Related Posts

Close Bitnami banner
Bitnami