Why do we use only string in Java?why not any other data types? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why do we use only string in Java?why not any other data types?

Very curious to learn things

27th Aug 2022, 4:13 PM
T.L. Avinash
T.L. Avinash - avatar
1 Answer
0
You mean in main method? It was implemented like that by developers.. and String array only only works well because it is used to read command line arguments which are mainly strings like file names, path names, flags,... Etc.. Anything can be stored as strings.. If you pass numbers then you can convert strings to desired types easily by String methods.. Hope it make sence...
29th Aug 2022, 8:55 AM
Jayakrishna 🇮🇳