Please read the description which contains a code . I have an error while compiling this code | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Please read the description which contains a code . I have an error while compiling this code

public class Program { public static void main(String[] args) { char x= 'manas'; char y= 'laud'; System.out.println (x+y); } }

19th Dec 2017, 2:49 PM
Manas Laud
Manas Laud - avatar
1 Answer
+ 3
The data type char is for single characters e.g. 'a' or 'n' , you cannot store your name in there unless you did 'm' and 'l' but even then you would get a numerical answer because of the unicode or something (correct me if I am wrong) so instead you want to use Strings like the code below and I think you will achieve what you wanted. https://code.sololearn.com/cNl83wLqVR9f/?ref=app
19th Dec 2017, 2:58 PM
Tarantino
Tarantino - avatar