~~~
package com;
public class Student {
String name;
int age;
String code;
String clazz;
void listen(String teacher){
System.out.println(teacher + "老师在给" + name + "上课!");
}
}
~~~
~~~
// 定义数组
int[] arrs2 = new int[]{1,2,3,4};
int[] arrs = {1,2,3,4}; // 简写
int j = 10;
String s1 = "Hello";
String s2 = "Hello";
Student tom = new Student();
tom.name = "tom";
tom.age = 22;
tom.code = "25";
tom.clazz = "Java96";
tom.listen("陆老师");
~~~