0

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
Chris Martin
  • 30,334
  • 10
  • 78
  • 137
Ahmad Nazirul
  • 63
  • 1
  • 1
  • 10

1 Answers1

2

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.

Saif
  • 6,804
  • 8
  • 40
  • 61