您的位置:首页 > 职场人生

java基础面试题之String字符串交换位置

2018-01-29 22:10 387 查看
package com.tarena.fly;

/**
* \* Created with IntelliJ IDEA.
* \* User: 武健
* \* Date: 2018/1/29
* \* Time: 20:45
* \* To change this template use File | Settings | File Templates.
* \* Description:String 字符串 交换位置
* \
*/
public class Main {
public static void main(String[] args) {
String a = "A";
String b = "B";
String temp = "";
temp = a;
a = b;
b = temp;
System.out.println(a);
System.out.println(b);

}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: