person.java

来自「新东方的」· Java 代码 · 共 31 行

JAVA
31
字号
public class Person
{
	private String name;
	int age;
	String sex;
	public Person()
	{
		System.out.println("构造器Person()被调用");
		name = "";
	}
	public Person(String theName)
	{	
		System.out.println("构造器Person(String theName)被调用");
		name = theName;
	}
	public Person(String theName,int theAge)
	{
		System.out.println("构造器Person(String theName,int theAge)被调用");
		name = theName;
		age = theAge;
	}
	public Person(String theName,int theAge,String theSex)
	{
		System.out.println("构造器Person(String theName,"
				+"int theAge,String theSex)被调用");
		name = theName;
		age = theAge;
		sex = theSex;
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?