📄 构造函数属性.txt
字号:
using System;
public class Square
{
private int sidelong;
public Square()
{
Console.WriteLine ("我没有参数.");
}
public Square(int sidelong)
{
this.sidelong=sidelong;
}
public int Setsidelong(int sidelong)
{
this.sidelong=sidelong;
return sidelong;
}
public int Getsidelong(int sidelong)
{
return sidelong;
}
public void Print()
{
Console.WriteLine ("当前正方形的边长是:{0}",sidelong);
}
}
class Square_Test
{
public static void Main()
{
Square s1=new Square ();
s1.Setsidelong (4);
s1.Print ();
Square s2=new Square ();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -