0
😁😁😁 Please can you tell me why this answer is the correct ?
String[] a = ("76.88").split("."); System.out.print(a.length); The answer is : 0 Remarque : This is a JavaScript language ? Why !?
4 Antworten
+ 5
"Car" and "Carpet" are completely different thing.
Don't get confuse with "Java" and "Javascript".
Alpha Diallo is right.
+ 2
This code is actually java and not javascript
+ 1
it must be a problem related to the code playground. under certain circumstances even the Scanner class goes crazy
on a pc it returns correctly 2
+ 1
It is a problem related to sololearn code playground: by replacing the dot by a plus "+" inside the string passed as argument to the 'split' method, that result to an error talking about regex, even if we don't use regex ^^
I highly suspect a bug in sololearn pre-parsing system that cause thoses error/unexpected results (sololearn at least parse quickly your code to determine if you need inputs when running it)
if you replace both dots by a minus "-", the expected result is correctly displayed in code playground (2)...