MCPcopy Create free account
hub / github.com/DuGuQiuBai/Java / main

Method main

day11/code/day11_Object/src/cn/itcast_02/StudentDemo.java:34–47  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

32 */
33public class StudentDemo {
34 public static void main(String[] args) {
35 Student s1 = new Student("����ϼ", 28);
36 Student s2 = new Student("����ϼ", 28);
37 Student s3 = new Student("����ϼ", 29);
38
39 // System.out.println(s1 == s1);
40 // System.out.println(s1 == s2);
41 System.out.println(s1.equals(s2));
42 System.out.println(s1.equals(s3));
43 System.out.println(s1.equals(s1));
44
45 Demo d = new Demo();
46 System.out.println(s1.equals(d)); //ClassCastException
47 }
48}
49
50class Demo{}

Callers

nothing calls this directly

Calls 1

equalsMethod · 0.95

Tested by

no test coverage detected