0
Converting variables to string
Hello So I'm still a newbie at this and i try to write codes as I progress. I have learnt how to print out strings but i also discovered i cant print out variables i have defined without converting them to strings. In my code titled mix up you'll see that i could only print out Name because it is already a variable of string type. Could someone teach me how to print out other variables that are not strings? i.e int, double, boolean, char etc..Kindly refer to my codes "mixup". Thank you. Deedee
4 Respostas
0
It's not that they are different datatypes, but you used commas (,), instead of peroids (.)
Also, you can include codes in your questions.
+ 3
The same applies for other datatypes you would store numbers in variables of type int.
int x = 10;
System.out.print(x+x);
0
I have fixed it, Thank you.
0
Thanks a lot...I'm loving this.