How to decide whether a statement requires citing a reliable source
Yes, there are rules on what requires citation.

Generally, publicly-known information (widely known, common knowledge, etc.) does not need to be cited. Your sentence about Java being class-based would fall under this category.

Information which is based on someone else's work (analysis, research, pictures, etc.), whether quoted or paraphrased, should always be cited. Your sentence about Java being x time slower/faster than C++ would fall under this category.

If you are unsure, cite it to be safe.