+ 1

Why string is final in java? Or how to split string in java.

28th Jun 2019, 5:27 AM
Jeetu Kumar
Jeetu Kumar - avatar
4 Respostas
+ 2
String a[] = "JavaScript".split("S"); System.out.println(a[0]); System.out.println(a[1]); //Output: Java cript
28th Jun 2019, 7:55 AM
Seb TheS
Seb TheS - avatar
+ 1
That string is final only means, that you can not change string after creating, even though string is a sequence of characters and you are able to index it, but you can't change string values, like you would change values in an array.
28th Jun 2019, 7:58 AM
Seb TheS
Seb TheS - avatar
+ 1
Thanks seb
28th Jun 2019, 6:49 PM
Jeetu Kumar
Jeetu Kumar - avatar