¡@

Home 

java Programming Glossary: method3

How slow are Java exceptions?

http://stackoverflow.com/questions/299068/how-slow-are-java-exceptions

Exception This one will regularly throw one public void method3 int i throws Exception value value i i 1 i 1 is equally fast.. t.reset for i 1 i 100000000 i try t.method3 i catch Exception e Do nothing here as we will get here l System.currentTimeMillis.. get here l System.currentTimeMillis l System.out.println method3 took l ms result was t.getValue Result method1 took 972 ms..

StringBuilder/StringBuffer vs. “+” Operator

http://stackoverflow.com/questions/4648607/stringbuilder-stringbuffer-vs-operator

value System.out.println The answer is value public void method3 int value String a The answer is value System.out.println a.. The answer is .append value .toString public void method3 int value String a new StringBuilder The answer is .append value.. is equivalent to manually use StringBuilder . On method3 the String concatenation is definitely bad as the compiler is..