使用Exlipse编写java程序
1.打开Exlipse新建javaproject
2.建立类class
3.输入以下程序
4.运行程序
package wjw3;
public class Surface {
public static void main(String[] args) {
student s1=new student();
s1.no="no=001";
s1.name="name=wangdaye";
s1.age="age=19";
System.out.println(s1.no);
System.out.println(s1.name);
System.out.println(s1.age);
s1.study();
}
}
class student{
String no;
String name;
String age;
void study(){
System.out.println("you must study hard!!!");
}
}
我你会了,您呢?