diff --git a/src/Lab3.java b/src/Lab3.java index 1bf2cf0..4d5c3f1 100644 --- a/src/Lab3.java +++ b/src/Lab3.java @@ -1,6 +1,11 @@ public class Lab3 { public static void main(String[] args) { String s = "ASD"; + + StringBuilder stringBuilder = new StringBuilder("ASD"); + + stringBuilder.append("A"); + String s2 = s; System.out.println("s2 = " + s2); System.out.println(s == s2); // true? @@ -18,8 +23,13 @@ public class Lab3 { // String Pool String s4 = "ASD"; - System.out.println(s4 == s2); // true? - System.out.println(s4.equals(s2)); // (true) +// String s5 = new String("ASD"); + String s5 = "AS"; + s5 += "D"; + System.out.println(s4 == s5); // true? (SP) + System.out.println(s4.equals(s5)); // (true) + + System.out.println("Done!"); } diff --git a/src/lab4/Main.java b/src/lab4/Main.java new file mode 100644 index 0000000..2e69f00 --- /dev/null +++ b/src/lab4/Main.java @@ -0,0 +1,7 @@ +package lab4; + +public class Main { + public static void main(String[] args) { + //todo equals+hashcode + } +}