Show comments for this question (0) Add comments Link to this question
1. public enum Color { RED, YELLOW, GREEN } 2. enum Fruit { 3. Banana(Color.RED), 4. Apple(Color.YELLOW), 5. Kiwi(Color.GREEN); 6. private Color color; 7. Fruit(Color color) { 8. this.color = color; 9. } 10. } 11. class Test { 12. public void method() { 13. // insert code here 14. } 15. }
3. class TestVars { 4. int x, y; 5. char c; 6. // insert code here 7. }
3. int calc() { 4. long x = 40L; 5. int i = 30; 6. i = x; 7. System.out.println("result is: " + i); 8. }
1. class Variables { 2. int i; 3. String s; 4. Object o; 5. String g = null; 6. Integer y; 7. char c; 8. }
5. // insert code here 6. public abstract void bark(); 7. } 8. 9. // insert code here 10. public void bark() { 11. System.out.println("woof"); 12. } 13. }
5. // insert code here 6. public void eat(); 7. } 8. 9. // insert code here 10. public void eat() { 11. System.out.println("eating dinner"); 12. } 13. }