Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Javaで変数をエスケープできますか? たとえば、PHP では次のようにできます。
$test = 3; echo "He is {$test} years old";
どちらが出力されますか:
He is 3 years old
Javaで同様のことができますか?
私はあなたがこの方法が必要だと思います
Int x=3; String test="He is "+x+"years old"; System.out.println(test); output He is 3 years old
私は質問を誤解しているかもしれませんが、私はそうします
int age = 3; System.out.println("He is " + age + " years old");