0

What will be the output ?

class test{ public static void main(String[] args){ int String = 100; System.out.println(String); } }

17th Sep 2020, 10:37 AM
soham990
soham990 - avatar
3 ответов
+ 1
Strings in Java are Objects that are backed internally by a char array. Here you decleared String as a variable name which type is int so it will print int value .
17th Sep 2020, 10:51 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 1
Just open solo ide and paste your code . simply it will print 100 without any error .
17th Sep 2020, 10:45 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
0
I want explanation why it gives 100 output. Why not compiler error?
17th Sep 2020, 10:48 AM
soham990
soham990 - avatar