Assertions in Java
assert Expression1 : Expression2; Expression1 is asserted to be true; otherwise AssertionError (that shouldn’t be handled) is thrown Expression2 allows to produce some additional information Expression2 MUST result in a value – it generates a String message allow testing during the development and debugging are disabled at runtime by default can be enabled using -ea…
High Performance Web Sites
Recently I’ve been reading “High Performance Web Sites” (look at amazon). I think it’s a good book who can be recommended to all who do even little bit of front end development. The book describes 15 rules (regarding CSS, JavaScript, etc.) that should be followed in order to deliver high performance web sites. It’s rather…
Threds: multiple call to run() method
You can call run() method of a thread many times. However, not a single new thread will be started. This way JVM will only execute the code from run() method. And this will not probably be what you tried to achieve. Remember: to start a new thread, you need to call start() method, which among…
Java: main method declaration
It’s good to remember that there are a few ways of defining the main() method in Java 5: public static void main(String[] args) {} or public static void main(String args[]) {} or public static void main(String… args) {} Sometimes, we don’t care and remeber of basic stuff, which can result in worse score on the…