Browse Source

删除 'W2周梓浩202506050319/Student.java.txt'

main
zhouzihao 4 weeks ago
parent
commit
1b05989ce0
  1. 33
      W2周梓浩202506050319/Student.java.txt

33
W2周梓浩202506050319/Student.java.txt

@ -1,33 +0,0 @@
class Student{
String studentId;
String name;
double score;
//define a study approach
void study() {
System.out.println(studentId+" "+name+"正在学习,上一次的成绩是"+score);
}
}
public class Main {
public static void main (String[] args) {
//setting up the first object
Student s1=new Student();
s1.studentId="001";
s1.name="George";
s1.score=90;
//setting up the second object
Student s2=new Student();
s2.studentId="002";
s2.name="Roya";
s2.score=95;
//using the approach study()
s1.study();
s2.study();
}
}
Loading…
Cancel
Save