Small snippets of code to help learn java