Advertisement
Guest User

Untitled

a guest
Jun 26th, 2012
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement