文字列をsplitで配列すると、下記のif文が通らなくなります。
間違っている点はありますか?
lang
1String str = "aiueo"; 2String[] ary = str.split(""); 3System.out.println(Arrays.toString(ary)); 4if (ary[0] == "a") { 5 System.out.println("ok"); 6} else { 7 System.out.println("no"); 8}
出力結果
[a, i, u, e, o]
no
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2015/08/30 01:44