Given: 11. public abstract class Shape { 12. int x; 13. int y; 14. public abstract void draw(); 15. public void setAnchor(int x, int y) { 16. this.x = x; 17. this.y = y; 18. } 19. }
and a class Circle that extends and fully implements the Shape class. Which is correct?
A. Shape s = new Shape(); s.setAnchor(10,10); s.draw(); B. Circle c = new Shape(); c.setAnchor(10,10); c.draw(); C. Shape s = new Circle(); s.setAnchor(10,10); s.draw(); D. Shape s = new Circle(); s->setAnchor(10,10); s->draw(); E. Circle c = new Circle(); c.Shape.setAnchor(10,10); c.Shape.draw();
[HeadFirst Java - p.234] 어떤 클래스의 인스턴스를 만들 수 없게 하는 간단한 방법이 있습니다. 즉 특정 유형에 대해 "new" 키워드를 쓸 수 없게 하는 방법입니다. 클래스를 abstract로 지정하면 컴파일러에서 그 유형의 인스턴스를 만드는 코드를 허용하지 않습니다. 하지만 그 추상 유형(abstract type)을 레퍼런스로 사용할 수 있습니다. 사실 그렇게 레퍼런스로 사용하는 것이 바로 이런 추상 클래스를 만드는 핵심적인 이유 중의 하나라고 볼 수 있습니다.
Given: 1. interface TestA { String toString(); } 2. public class Test { 3. public static void main(String[] args) { 4. System.out.println(new TestA() { 5. public String toString() { return “test”; } 6. }); 7. } 8. }
What is the result?
A. test B. null C. An exception is thrown at runtime. D. Compilation fails because of an error in line 1. E. Compilation fails because of an error in line 4. F. Compilation fails because of an error in line 5.
Rei Diaz, 선임 조교 Dan Armendariz, 조교 Eugenia Kim, 조교 Chris Thayer, 편집자 Chris Mehl, 비디오작가
이 코스는 다음의 이해에 관한 모든 것입니다: 당신이 스위치를 켤 때 컴퓨터 안에서 어떤 일이 벌어지는지, 왜 기술지원은 항상 당신의 컴퓨터를 재부팅 시키는지, 당신이 인터넷에서 한 모든 일들이 어떻게 다른 사람들에게 보여지는지, 그리고 어떻게 당신의 컴퓨터가 단지 컴퓨터를 켜는 것만으로도 웜에 감염될 수 있는지에 대한 이해를 할 수 있게 됩니다.
이 코스에서 우리들은 전문 용어와 함께 컴퓨터와 인터넷에 대한 신비함을 사라지게 합니다. 그리고 학생들이 각각 무엇을 할 수 있는지 뿐만 아니라, 모든 용어와 이유 역시 이해할 수 있도록 합니다. 학생들은 이 코스를 마칠 때 새로운 어휘와 좀 더 나은 컴퓨터와 인터넷에 대한 소양을 갖추게 됩니다.
주제는 하드웨어, 소프트웨어, 인터넷, 멀티미디어, 보안, 웹사이트 개발, 프로그램 작성, 그리고 .com을 포함합니다. 이 코스는 컴퓨터 초보자 뿐만 아니라 매일 컴퓨터를 사용하는 사람들 모두를 대상으로 합니다.
(번역 도움 : 배정탁 in JJSSM)
Computer Science E-1: Understanding Computers and the Internet
Harvard Extension School
filmed in Cambridge, Massachusetts September 2006 – January 2007
also available: Computer Science 50: Introduction to Computer Science I Harvard College
Rei Diaz, Head Teaching Fellow Dan Armendariz, Teaching Fellow Eugenia Kim, Teaching Fellow Chris Thayer, Editor Chris Mehl, Videographer
This course is all about understanding: understanding what's going on inside your computer when you flip on the switch, why tech support has you constantly rebooting your computer, how everything you do on the Internet can be watched by others, and how your computer can become infected with a worm just by turning it on. In this course we demystify computers and the Internet, along with their jargon, so that students understand not only what they can do with each but also how it all works and why. Students leave this course armed with a new vocabulary and equipped for further exploration of computers and the Internet. Topics include hardware, software, the Internet, multimedia, security, website development, programming, and dotcoms. This course is designed both for those with little, if any, computer experience and for those who use a computer every day.