The Biggest Java WTF
Today one of my co-workers send me the following link.
As I couldn’t believe my eyes, I have tested it myself.
WTF?
package wtfjava;
/**
* This program really HANGS!!!!
* @author kris
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
System.out.println("Test:");
double d = Double.parseDouble("2.2250738585072012e-308");
System.out.println("Value: " + d);
}
}
/**
* This program really HANGS!!!!
* @author kris
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
System.out.println("Test:");
double d = Double.parseDouble("2.2250738585072012e-308");
System.out.println("Value: " + d);
}
}
Great post.