📄 student3.java~1~
字号:
package Student3;class Date{ int year; int month; int day; Date(int year,int month,int day){ this.year=year; this.month=month; this.day=day; } void showDate(){ System.out.println(year+"-"+month+"-"+day); }}public class Student3 { String no; String name; Date birth; // 对象变量作类的成员,莫认初始值为 null void setStu(String s1,String s2,int y,int m,int d){ no=s1; name=s2; birth=new Date(y,m,d); } Date getBirth(){ return birth; }public static void main(String[] args) { Student3 stu=new Student3(); stu.setStu("sun","xiaomei",1977,12,27); stu.getBirth().showDate(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -