+ 1
Can anyone tell me the output of this question?
String a="String"; System.out.print("a".length());
8 Antworten
+ 4
Atul Panda
May be you are mistaken..can you show the screenshot of that question..?
+ 2
1
Because the a is enclosed in double quotes so now it acts as a string and not reffering to the variable a.
+ 2
Sorry but in the question it was given "mystr"
Sorry to distrub you all for my negligence 😞😭
+ 1
1
becose "a" is a String with lenght 1
becose a is a variable with type as String and lenght 6
0
The answer is 5. I got this question from a challenge at sololearn and it is showing 5 as the answer