fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.PrintStream;
  4. class Main
  5. {
  6. static PrintStream o = System.out;
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. Float nan=Float.NaN;
  10. Float nan1=Float.NaN;
  11. Double d=Double.NaN;
  12. o.println(new Float(10).compareTo(nan));
  13. o.println("POS_INF ? NaN:"+new Float(Float.POSITIVE_INFINITY).compareTo(nan));
  14. o.println("NaN ? NaN:"+nan.compareTo(nan));
  15. o.println(nan==nan);
  16. o.println(nan==nan1);
  17. o.println(nan==Float.NaN);
  18. o.println(nan.equals(new Float(Float.NaN)));
  19.  
  20. o.println("========Test Byte Equality ======");
  21. Byte b=(byte)2;
  22. o.println("Equals(2):"+b.equals(2));
  23. o.println("b==2:"+(b==2) );
  24.  
  25. o.println("========And now test Some Integers======");
  26.  
  27. Integer i=new Integer(2);
  28. Integer i1 =2;
  29. o.println("Equals(2):"+i.equals(2));
  30. o.println("i==2:"+(i==i1));
  31. o.println("========And now Mix in======");
  32. o.println(b.equals(i));
  33. o.println("========May be thats way?======");
  34. Object o1=b,o2=i;
  35. o.println(o1==o2);
  36. o.println("========Fuck... Java is pile of shit.======");
  37. o.println("========Dont use it======");
  38.  
  39. }
  40. }
Success #stdin #stdout 0.06s 215488KB
stdin
Standard input is empty
stdout
-1
POS_INF ? NaN:-1
NaN ? NaN:0
true
false
false
true
========Test Byte Equality ======
Equals(2):false
b==2:true
========And now test Some Integers======
Equals(2):true
i==2:false
========And now Mix in======
false
========May be  thats way?======
false
========Fuck... Java is pile of shit.======
========Dont use it======