Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

132937 views
License: OTHER
1
public class QuizString {
2
public static void main(String[] args) {
3
String string1 = new String("Hallo");
4
String string2 = new String("Hallo");
5
if (string1 == string2) {
6
System.out.println("string1 und string2 sind das selbe Objekt.");
7
} else {
8
System.out.println("string1 und string2 sind verschiedene Objekte.");
9
}
10
11
String string3 = "Hallo";
12
String string4 = "Hallo";
13
if (string3 == string4) {
14
System.out.println("string3 und string4 sind das selbe Objekt.");
15
} else {
16
System.out.println("string3 und string4 sind verschiedene Objekte.");
17
}
18
}
19
}
20
21
22