0
String + int
Hi, I got lot of times in the challenge code like this : public static void main(String[] args){ String str = "5"; Int i = 10; System.out.println(str+i); } If i try to compile this in the console i got a error. But in the challenge from solo learn there i never got a error. Why?
4 Respostas
+ 8
The primitive datatype is int (lowercase i), not I (uppercase i). If you correct that it compiles and runs just fine.
+ 3
it should look like this
String str = "5";
int i = 10; <<"like tash said int begins with lowercase i"
System.out.println(str+i);
output is 510
+ 2
maybe 510 :))
+ 1
@buran9 😂 oops corrected