+ 2
Strings
Good morning! Each time i code and when i am dealing with strings i face a problem for example when i initialize a string in this way: String[] say="Hello"; and in this way: String talk="Hello"; when i use for example the method say.equals(talk); i got an arror telling cannot convert from String[] to String.. So my question is that i want to know the difference between them Thank you in advance!
7 Réponses
+ 6
String[] say;
This is a String array, on the other hand;
String talk;
is a String variable, an array is like a matchbox, one matchbox contains many match sticks, a String array is a variable that can hold multiple references of String, an array can contain only values of the same type as the array.
I don't know if you have got to the chapter covering about arrays, but if you did, I guess a review on the chapter couldn't hurt. Feel free to ask if you still feel like not getting it right : )
+ 2
Hello
+ 1
You want to know differences between String and string[]?
So,I don’t know it for 100%,but into [] after string you could add some func or something.I hope this help😉
0
Ben i didn't get tje answer but thank you anyways
0
Oh,so sorry not professional english translator😶
0
😂
0
🤣🤣🤣🤣🤣