잘난놈되기/SCJP
Q018. 인터페이스
whatwant
2008. 4. 13. 20:43
Question 18 : 인터페이스
Given:
1. public interface A {
2. String DEFAULT_GREETING = “Hello World”;
3. public void method1();
4. }
A programmer wants to create an interface called B that has A as its parent. Which interface declaration is correct?
A. public interface B extends A { }
B. public interface B implements A { }
C. public interface B instanceOf A { }
D. public interface B inheritsFrom A { }
[HeadFirst Java - p.258]
# 인터페이스 정의
public interface Pet {...}
# 인터페이스 구현
public class Dog extends Canine implements Pet {...}
//A를 부모로 하여 B라는 인터페이스를 만들려고 한다. 인터페이스의 정의가 올바른 것은?
Answer: A
Given:
1. public interface A {
2. String DEFAULT_GREETING = “Hello World”;
3. public void method1();
4. }
A programmer wants to create an interface called B that has A as its parent. Which interface declaration is correct?
A. public interface B extends A { }
B. public interface B implements A { }
C. public interface B instanceOf A { }
D. public interface B inheritsFrom A { }
[HeadFirst Java - p.258]
# 인터페이스 정의
public interface Pet {...}
# 인터페이스 구현
public class Dog extends Canine implements Pet {...}
//A를 부모로 하여 B라는 인터페이스를 만들려고 한다. 인터페이스의 정의가 올바른 것은?
Answer: A
반응형