I am having difficulties knowing which of the following classes / interfaces can I instantiate in the Main
method (which class / interface is completely OK). The code goes like this for some of the classes and interfaces:
interface A {public void Method();}
class B {public static int b;}
abstract class C:B {public void Method1();}
sealed class D:B {} ;
class E:A {};
class F:A {public void Method();}
class G:C {};
And then later on, we have the Main method in another Class, like this...
class Program
{
static void Main(string[] args)
{
A a = new A();
B b = new B();
A ab = new B();
B ba = new A();
C c = new C();
D d = new D();
E e = new E();
F af = new A();
A fa = new F();
G g = new G();
}
}
So, which ones can we use from above? I know it's a silly question to ask, but this is what we actually get on out test at University.