java - android java 字符串操作

标签 java equivalent

此 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/

相关文章:

java - 通过 weblogic 识别谁在使用证书

java - 在 JUnit 参数化测试中使用非静态注入(inject)服务

MySQL DB 选择带和不带变音符号的记录。例如 : '.. where something = FÖÖ'

c++ - 具有一个版本的等效代码的 SegFault?

java - 如何删除 GridLayout 组合中行之间的间距?

java - 获取ActiveMQ中的队列名称列表

java - 像 Python 字典一样循环 Java HashMap?

java - Python 字符串 'Template' 在 java 中等效

c# - C# 泛型约束 "T,K: where T : It<K>"的 Java 等价物是什么?

Java 服务器自签名证书 + 客户端证书和 SSL - 连接重置