Question: Can I use try/catch block to
control program flow? Will it affect program performance?
Answer: Try/catch block itself does not add
much overhead to your program. Handling of thrown exception can be expensive.
Use try/catch block only for error handling, not to control program flow.
Especially try to avoid placing within loops.
Question: I have a method that names
something like this - public String doSmth()...
I do not need any Object for this method. Can I make it static?
Is it good idea to make all methods that do not use Objects static?
Answer: yes, I think so. It is bad idea to
create an instance of the class just to use one method without needing the
itself. Wasting of memory and CPU performance for further garbage collecting of
the Object that has not been used