tailieunhanh - Sun certified programmer developer for java 2 study guide phần 8

Những câu hỏi sau đây sẽ giúp bạn đo lường sự hiểu biết của bạn năng động và vật liệu làm thay đổi cuộc sống được trình bày trong chương này. Bởi vì chương này kéo dài rất nhiều mục tiêu khác nhau, các câu hỏi ở đây không được tổ chức trong các loại mục tiêu cụ thể. Đọc tất cả những sự lựa chọn một cách cẩn thận. | Self Test 27 SELF TEST The following questions will help you measure your understanding of the dynamic and life-altering material presented in this chapter. Because this chapter spans so many different objectives the questions here are not organized in specific objective categories. Read all of the choices carefully. Choose all correct answers for each question. Take your time. Breathe. 1. Given the following public class MyOuter public static class MyInner public static void foo which statement if placed in a class other than MyOuter or MyInner instantiates an instance of the nested class A. m new B. mi new MyInner C. MyOuter m new MyOuter mi D. MyInner mi new 2. Which two are true about a static nested class A. You must have a reference to an instance of the enclosing class in order to instantiate it. B. It does not have access to nonstatic members of the enclosing class. C. Its variables and methods must be static. D. It can be instantiated using new . E. It must extend the enclosing class. 3. Which constructs an anonymous inner class instance A. Runnable r new Runnable B. Runnable r new Runnable public void run C. Runnable r new Runnable public void run D. Runnable r new Runnable public void run E. new Runnable public void run F. new Runnable public void run 28 Chapter 8 Inner Classes 4 Given the following class Boo Boo String s Boo class Bar extends Boo Bar Bar String s super s void zoo insert code here which two create an anonymous inner class from within class Bar Choose two. A. Boo f new Boo 2 4 B. Boo f new Bar C. Boo f newBoo Strings D. Bar f new Boo String s E. Boo f new String s 5. Given the following 1. class Foo 2. class Bar 3. 4. class Test 5. public static void main String args 6. Foo f new Foo 7. Insert code here 8. 9. which statement inserted at line 5 creates an instance of Bar A. .

TỪ KHÓA LIÊN QUAN