1
0
Fork 0
beispiele_pr2/src/main/java/pr2/auffrischung/quiz/Swap.java

23 lines
419 B
Java

/* (c) 2022 Thomas Smits */
package pr2.auffrischung.quiz;
public class Swap {
void swap(String s1, String s2) {
String temp = s1;
s1 = s2;
s2 = temp;
}
void swapMe() {
String s1 = "Hallo";
String s2 = "Welt";
swap(s1, s2);
System.out.println(s1 + " " + s2);
}
public static void main(String[] args) {
new Swap().swapMe();
}
}