android java string operation

103 Views Asked by At

What is the equivalent Java for this PHP code?

//print string plus/with variable     
$mystring = "this is string " .$string

//print sum one + two
$count = $one + $two

//print sum one*two
$count = $one * $two
1

There are 1 best solutions below

3
On BEST ANSWER

It should be like :

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;

But i would suggest to learn basics of java before starting android. As you know php it will not take long to learn java syntax.