有什么办法可以在 C# 中做到这一点吗?我不能在 C# 代码中使用 this(int,int) 。你能给我写一些类似的代码,它们会在 C# 中做同样的事情吗?谢谢!:)
public class JavaApplication2
{
public static class SomeClass
{
private int x;
private int y;
public SomeClass () { this(90,90); }
public SomeClass(int x, int y) { this.x = x; this.y = y; }
public void ShowMeValues ()
{
System.out.print(this.x);
System.out.print(this.y);
}
}
public static void main(String[] args)
{
SomeClass myclass = new SomeClass ();
myclass.ShowMeValues();
}
}