Description: 1, if you just want to know the correct answer, copy the code to run on vs.
2, these 3 questions I will not do, seek guidance (only need to tell me the knowledge point of the investigation on the line ~)
1. What is wrong with the code below, and if so, how to correct it? (I feel right ~ ~)
public class A {public virtual void F () { Console.WriteLine ("A.F"); } } Public abstract class B:a {public abstract override void F (); }
2, a comprehensive problem, the following program output is? (feeling very comprehensive, ask the master to tell this question have examined what knowledge points ~ ~ ~)
Using System;namespace consoleapplication1{ internal class program { private static void Main (string[] args) { var a = new A (); A B = new B (); A.fun2 (b); B.fun2 (a); Console.readkey (); } } Internal Class A {public a () { Console.WriteLine ("a"); } public virtual void Fun1 (int i) { Console.WriteLine (i); } public virtual void Fun2 (a a) { a.fun1 (1); FUN1 (3); } } Internal class b:a {public B () { Console.WriteLine ("B"); } public override void Fun1 (int i) { base. FUN1 (i + 1); } Public new void Fun2 (a a) { a.fun1 (2); FUN1 (5);}}
3, the overall problem, the following program output is? (also answer wrong, ask to tell what knowledge points have been examined ~ ~)
Using System;namespace consoleapplication2{ internal class program { private static void Main (string[] args) { Console.WriteLine ("X={0},y={1}", A.x.tostring ("X2"), B.y.tostring ("X")); Console.readkey (); } } public class A {public static int x; } public class B {public static int y = a.x + 1; Static B () { }} }
June 26. NET face question (program part) as long as do understand these 3 questions must be able to leave the rookie title!