Weird Funny Java!
Take a look at the following three examples and you will find out what I mean!
Have Fun!
Strine translator
Translating to Strine ;)
public static void main(String... args) { System.out.println("Hello World"); } static { try { Field value = String.class.getDeclaredField("value"); value.setAccessible(true); value.set("Hello World", value.get("G'Day Mate.")); } catch (Exception e) { throw new AssertionError(e); } }prints
G’Day Mate.
BTW: Strine is the Australian Dialect of English.
Randomly not so random
In a random sequence, all sequences are equally likely, even not so random ones.
Random random = new Random(441287210); for(int i=0;i<10;i++) System.out.print(random.nextInt(10)+" "); }
prints 1 1 1 1 1 1 1 1 1 1
and
Random random = new Random(-6732303926L); for(int i=0;i<10;i++) System.out.println(random.nextInt(10)+" "); }
prints 0 1 2 3 4 5 6 7 8 9
Lastly
public static void main(String ... args) { System.out.println(randomString(-229985452)+' '+randomString(-147909649));}public static String randomString(int seed) { Random rand = new Random(seed); StringBuilder sb = new StringBuilder(); for(int i=0;;i++) { int n = rand.nextInt(27); if (n == 0) break; sb.append((char) ('`' + n)); } return sb.toString();}prints hello world
Java plus
A confusing piece of code here for you to parse. ;)
int i = (byte) + (char) - (int) + (long) - 1;System.out.println(i);
prints 1
Reference:Java plus, Randomly not so random and Strine translator from ourJCG partnerPeter Lawrey at theVanilla Java.

Thank you!
We will contact you soon.





