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

Method main

day12/code/day12_String/src/cn/itcast_02/StringDemo3.java:7–22  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

5 */
6public class StringDemo3 {
7 public static void main(String[] args) {
8 String s1 = new String("hello");
9 String s2 = new String("hello");
10 System.out.println(s1 == s2); // false
11 System.out.println(s1.equals(s2)); // true
12
13 String s3 = new String("hello");
14 String s4 = "hello";
15 System.out.println(s3 == s4); // false
16 System.out.println(s3.equals(s4)); // true
17
18 String s5 = "hello";
19 String s6 = "hello";
20 System.out.println(s5 == s6);// true
21 System.out.println(s5.equals(s6));// true
22 }
23}

Callers

nothing calls this directly

Calls 1

equalsMethod · 0.45

Tested by

no test coverage detected