Darren

|
分享:
▲
這樣行嗎? 能跑就是了(心虛...)
using System;
namespace ConsoleApplication1 { /// <summary> /// Class1 的摘要描述。 /// </summary> class Class1 { /// <summary> /// 應用程式的主進入點。 /// </summary> [STAThread] static void Main(string[] args) { // // TODO: 在此加入啟動應用程式的程式碼 // Console.WriteLine("Testing ..."); B o1 = new B(); B o2 = new B(1); B o3 = new B("Mary"); B o4 = new B(o1); B o5 = new B(o1,o2); B o6 = new B(o4.goo()); A o7 = o6.obj; B.val = o4.goo() + B.abc(); o1.foo().foo(); B.val+=o2.koo(5); o5.obj.foo(); o7.foo(); Console.ReadLine(); } } class A { public void foo() {Console.WriteLine("A's foo() is called!");} } class B { public static long val=0L; public A obj { get{return new A();} } public A foo() {return new A();}
public long koo(int param) {return param;}
public static long abc() {return 10L;}
public B() {Console.WriteLine("B's o1 is called!");}
public B(int param) {Console.WriteLine("B's o2 is called!");}
public B(string param) {Console.WriteLine("B's o3 is called!");}
public B(object param) {Console.WriteLine("B's o4 is called!");}
public B(object param1, object param2) {Console.WriteLine("B's o5 is called!");}
public B(long param) {Console.WriteLine("B's o6 is called!");}
public long goo() { return 100L; } } }
此文章被評分,最近評分記錄| 財富:30 (by codeboy) | 理由: 感謝您的回覆喔~^^ | |
|
|
|