Core java code snippets.