Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jun 26th, 2012  |  syntax: None  |  size: 0.88 KB  |  views: 120  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. public class App {
  2.  
  3.     public static void main(String[] args) throws Exception {
  4.  
  5.         System.out.println("Java Version: " + System.getProperty("java.vm.version"));
  6.  
  7.         for (int i = 0; true; i++) {
  8.             for (int j = 0; j < 100; j++) {
  9.                 // short delay (required)
  10.             }
  11.  
  12.             String s = "hello";
  13.             s = new StringBuilder(String.valueOf(s)).append(s).toString();
  14.             s = new StringBuilder(String.valueOf(s)).append(s).toString();
  15.  
  16.             if (s.length() != 20) {
  17.                 System.out.println("Failed at iteration: " + i);
  18.                 System.out.println("Length mismatch: " + s.length() + " <> " + 16);
  19.                 System.out.println("Expected:   \"hellohellohellohello\"");
  20.                 System.out.println("Actual:   \"" + s + "\"");
  21.                 System.exit(0);
  22.             }
  23.         }
  24.     }
  25. }