此 PHP 代码的等效 Java 是什么?
//print string plus/with variable
$mystring = "this is string " .$string
//print sum one + two
$count = $one + $two
//print sum one*two
$count = $one * $two
最佳答案
应该是这样的:
String mystring= "this is string " + string; // here `string` is aloso String object
/*
* if count ,one and two all of them are int
*/
int count = one + two;
int count = one * two;
但我建议在开始 android 之前先学习 java 基础知识。正如您所了解的 php,学习 java 语法不会花费很长时间。
关于java - android java 字符串操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27466734/