📜  交换 Java 基元值 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:16.508000             🧑  作者: Mango

代码示例1
// Swapping values
team1 = "A";
team2 = "OSU";

String temp = team2; // team1 = "A", team2 = "OSU", temp = "OSU" 
team2 = team1;       // team1 = "A", team2 = "A", temp = "OSU" 
team1 = temp;        // team1 = "OSU", team2 = "A", temp = "OSU"