How to set a JVM TimeZone Properly
You can pass the JVM this param -Duser.timezone For example -Duser.timezone=Europe/Sofia and this should do the trick. Setting the environment variable TZ also does the trick on Linux.
You can pass the JVM this param -Duser.timezone For example -Duser.timezone=Europe/Sofia and this should do the trick. Setting the environment variable TZ also does the trick on Linux.
In Joshua Bloch’s Effective Java, Item 5: “Avoid creating unnecessary objects”, he posts the following code example: public static void main(String[] args) { Long sum = 0L; // uses Long, not long for (long i = 0; i <= Integer.MAX_VALUE; i++) { sum += i; } System.out.println(sum); } and it takes 43 seconds to run. … Read more
In Java 8: List<String> newList = Stream.concat(listOne.stream(), listTwo.stream()) .collect(Collectors.toList());