Java☝:: A most beautiful and powerful programming language👌.
as much as you'll deep dive into Java you'll learn something new.
Here are some Amazing and cool trick's -
1-
Do you know what will be the output of the below statement? 👇
System.out.println(0123);
o/p = 83 but why?
Click on Below - 👇👇👇
https://www.javaoneworld.com/2020/05/why-output-of-012-is-10-and-0123-is-83.html
2- Java String
Concatenation - concat() Vs the + Operator
concat() --
if want to concat str1 with str2 where str1 is null.
str1 = null;
str2 = "javaoneworld";
str1.concat(str2);
you'll get NullPointerException👎👎.
- Operator --
if want to concat str1 with str2 where str1 is null.
str1 = null;
str2 = "javaoneworld";
str1+str2;
you'll not get NullPointerException instead you'll get some output😅😀.
o/p - nulljavaoneworld
Follow the below beautiful url for some more cool tricks.
How to execute commented code? and more.
https://www.javaoneworld.com/2021/07/java-amazing-interesting-and-cool-tricks.html
Thanks a bunch for being here.
Top comments (0)