Different Java Code Samples