Learning Java example