MCPcopy Create free account
hub / github.com/GCMiner/GCMiner / Student

Class Student

src/test/java/examples/Student.java:4–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2import java.util.Random;
3
4public class Student {
5 public int getAge() {
6 return age;
7 }
8
9 public void setAge(int age) {
10 this.age = age;
11 }
12
13 private int age;
14
15 public int getGrade() {
16 return grade;
17 }
18
19 public void setGrade(int grade) {
20 this.grade = grade;
21 }
22
23 private int grade;
24
25 @Override
26 public String toString() {
27 return "Student{" +
28 "age=" + age +
29 ", grade=" + grade +
30 '}';
31 }
32
33 public void display() {
34 System.out.println(this.toString());
35 }
36 public void learn() throws Exception{
37// long start = System.currentTimeMillis();
38 Random rand = new Random();
39 int time = rand.nextInt(1000)+3000;
40 Thread.sleep(time);
41// long end = System.currentTimeMillis();
42// System.out.println(end-start);
43 }
44 public static void main(String[] args) {
45 Student s = new Student();
46 s.display();
47 try{
48 s.learn();
49 }
50 catch (Exception e){
51
52 }
53
54 }
55}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected