In Java, the output of the below statement is 3 = 12
1System.out.println(1+2+" = "+1+2);
Why??
Because Java starts treating everything as a String once it has found a string in System.out statement. Interesting, huh...
This website uses cookies to ensure you get the best experience. More info...
No comments:
Post a Comment