Why does this code, written backwards, print “Hello World!”
I found this on the Internet:-
class M{public static void main(String[]a){System.out.print(new char[]
{'H','e','l','l','o',' ','W','o','r','l','d','!'});}}
This code prints Hello World!
onto the screen. Clearly it can be seen public static void main
is written backwards. How does this code work? How does this even compile?