网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
单选题
10. class Nav{ 11. public enum Direction { NORTH, SOUTH, EAST, WEST } 12. } 13. public class Sprite{ 14. // insert code here 15. } Which code, inserted at line 14, allows the Sprite class to compile?()
A
Direction d = NORTH;
B
Nav.Direction d = NORTH;
C
Direction d = Direction.NORTH;
D
Nav.Direction d = Nav.Direction.NORTH;
参考答案
参考解析
解析:
暂无解析
更多 “单选题10. class Nav{ 11. public enum Direction { NORTH, SOUTH, EAST, WEST } 12. } 13. public class Sprite{ 14. // insert code here 15. } Which code, inserted at line 14, allows the Sprite class to compile?()A Direction d = NORTH;B Nav.Direction d = NORTH;C Direction d = Direction.NORTH;D Nav.Direction d = Nav.Direction.NORTH;” 相关考题
考题
定义枚举如下:publicenumDirection{EAST,SOUTH,WEST,NORTH}下列正确使用该枚举类型的语句是哪项?()
A.DirectionDirection=EAST;B.Directiondirection=Direction.WEST;C.inta-Direction.NORTH;D.Directiondirection=2;
考题
classNav{11.publicenumDirection{NORTH,SOUTH,EAST,WEST}12.}13.publicclassSprite{14.//insertcodehere15.}Whichcode,insertedatline14,allowstheSpriteclasstocompile?()
A.Directiond=NORTH;B.Nav.Directiond=NORTH;C.Directiond=Direction.NORTH;D.Nav.Directiond=Nav.Direction.NORTH;
考题
Given:10. interface Data { public void load(); }11. abstract class Info { public abstract void load(); }Which class correctly uses the Data interface and Info class?()()
A.B.C.D.E.F.
考题
Given:Which code, inserted at line 14, allows the Sprite class to compile?()
A.Direction d = NORTH;B.Nav.Direction d = NORTH;C.Direction d = Direction.NORTH;D.Nav.Direction d = Nav.Direction.NORTH;
考题
If the center of low pressure is due west of you in the Northern Hemisphere, which wind direction should you expect?A.South to westB.South to eastC.West to northD.North to east
考题
In the Northern Hemisphere a wind is said to veer when the wind ______.A.changes direction clockwise, as from north to east, etcB.changes direction counterclockwise, as from south to east, etcC.changes direction violently and erraticallyD.remains constant in direction and speed
考题
In the Northern Hemisphere, if the center of a high pressure area is due west of you, what wind direction would you expect?______.A.South to westB.South to eastC.North to westD.North to east
考题
10. public class ClassA { 11. public void count(int i) { 12. count(++i); 13. } 14. } And: 20. ClassA a = new ClassA(); 21. a.count(3); Which exception or error should be thrown by the virtual machine?() A、 StackOverflowErrorB、 NullPointerExceptionC、 NumberFormatExceptionD、 IllegalArgumentExceptionE、 ExceptionlnlnitializerError
考题
10. class Line { 11. public static class Point { } 12. } 13. 14. class Triangle { 15. // insert code here 16. } Which code, inserted at line 15, creates an instance of the Point class defined in Line?() A、 Point p = new Point();B、 Line.Point p = new Line.Point();C、 The Point class cannot be instatiated at line 15.D、 Line 1 = new Line() ; 1.Point p = new 1.Point();
考题
10. abstract public class Employee { 11. protected abstract double getSalesAmount(); 12. public double getCommision() { 13. return getSalesAmount() * 0.15; 14. } 15. } 16. class Sales extends Employee { 17. // insert method here 18. } Which two methods, inserted independently at line 17, correctly complete the Sales class?()A、 double getSalesAmount() { return 1230.45; }B、 public double getSalesAmount() { return 1230.45; }C、 private double getSalesAmount() { return 1230.45; }D、 protected double getSalesAmount() { return 1230.45; }
考题
Assume that country is set for each class. Given: 10. public class Money { 11. private String country, name; 12. public getCountry() { return country; } 13.} and: 24. class Yen extends Money { 25. public String getCountry() { return super.country; } 26. } 27. 28. class Euro extends Money { 29. public String getCountry(String timeZone) { 30. return super.getCountry(); 31. } 32. } Which two are correct?()A、 Yen returns correct values.B、 Euro returns correct values.C、 An exception is thrown at runtime.D、 Yen and Euro both return correct values.E、 Compilation fails because of an error at line 25.F、 Compilation fails because of an error at line 30.
考题
定义枚举如下: public enum Direction{ EAST,SOUTH,WEST,NORTH } 下列正确使用该枚举类型的语句是哪项?() A、Direction Direction=EAST;B、Direction direction=Direction.WEST;C、int a- Direction.NORTH;D、Direction direction=2;
考题
10. class Line { 11. public class Point { public int x,y; } 12. public Point getPoint() { return new Point(); } 13. } 14. class Triangle { 15. public Triangle() { 16. // insert code here 17. } 18. } Which code, inserted at line 16, correctly retrieves a local instance of a Point object?() A、 Point p = Line.getPoint();B、 Line.Point p = Line.getPoint();C、 Point p = (new Line()).getPoint();D、 Line.Point p = (new Line()).getPoint();
考题
Given: 10. class One { 11. void foo() { } 12. } 13. class Two extends One { 14. //insert method here 15. } Which three methods, inserted individually at line 14, will correctly complete class Two?()A、 public void foo() { /* more code here */ }B、 private void foo() { /* more code here */ }C、 protected void foo() { /* more code here */ }D、 int foo() { /* more code here */ } E、 void foo() { /* more code here */ }
考题
You work as an application developer at Certkiller .com. You have recently created a custom collection class named ShoppingList for a local supermarket. This custom class will include ShoppinItem objects that have the public properties listed below. * Name * AisleNumber * OnDiscount You are required to enable users of your class to iterate through the ShoppingList collection, and to list each product name and aisle number using the foreach statement.You need to achieve this by declaring the appropriate code.What code should you use?()A、 public class ShoppingList : ICollection {// Class implementation }B、 public class ShoppingList : IEnumerator, IEnumerable {// Class implementation }C、 public class ShoppingList : Ilist {// Class implementation }D、 public class ShoppingList : Enum {// Class implementation }
考题
单选题Given: Which code, inserted at line 14, allows the Sprite class to compile?()A
Direction d = NORTH;B
Nav.Direction d = NORTH;C
Direction d = Direction.NORTH;D
Nav.Direction d = Nav.Direction.NORTH;
考题
单选题10. interface Foo { int bar(); } 11. public class Sprite { 12. public int fubar( Foo foo) { return foo.bar(); } 13. public void testFoo() { 14. fubar( 15. // insert code here 16.); 17. } 18. } Which code, inserted at line 15, allows the class Sprite to compile?()A
Foo { public int bar() { return 1; } }B
new Foo { public int bar() { return 1; } }C
newFoo() { public int bar(){return 1; } }D
new class Foo { public int bar() { return 1; } }
考题
单选题In the Northern Hemisphere a wind is said to veer when the wind().A
Changes direction clockwise,as from north to east,etcB
Changes direction violently and erraticallyC
Remains constant in direction and speedD
Changes direction counterclockwise,as from south to east,etc
考题
单选题10. class Line { 11. public static class Point { } 12. } 13. 14. class Triangle { 15. // insert code here 16. } Which code, inserted at line 15, creates an instance of the Point class defined in Line?()A
Point p = new Point();B
Line.Point p = new Line.Point();C
The Point class cannot be instatiated at line 15.D
Line 1 = new Line() ; 1.Point p = new 1.Point();
考题
多选题import java.awt.*; public class X extends Frame { public static void main (String args) { X x = new X(); x.pack(); x.setVisible(true); } public X() { setLayout (new BordrLayout()); Panel p = new Panel (); add(p, BorderLayout.NORTH); Button b = new Button (“North”); p.add(b): Button b = new Button (“South”); add(b1, BorderLayout.SOUTH): } } Which two statements are true?()AThe buttons labeled “North” and “South” will have the same width.BThe buttons labeled “North” and “South” will have the same height.CThe height of the button labeled “North” can very if the Frame is resized.DThe height of the button labeled “South” can very if the Frame is resized.EThe width of the button labeled “North” is constant even if the Frame is resized.FThe width of the button labeled “South” is constant even if the Frame is resized.
考题
单选题10. class Line { 11. public class Point { public int x,y; } 12. public Point getPoint() { return new Point(); } 13. } 14. class Triangle { 15. public Triangle() { 16. // insert code here 17. } 18. } Which code, inserted at line 16, correctly retrieves a local instance of a Point object?()A
Point p = Line.getPoint();B
Line.Point p = Line.getPoint();C
Point p = (new Line()).getPoint();D
Line.Point p = (new Line()).getPoint();
考题
单选题10. public class ClassA { 11. public void count(int i) { 12. count(++i); 13. } 14. } And: 20. ClassA a = new ClassA(); 21. a.count(3); Which exception or error should be thrown by the virtual machine?()A
StackOverflowErrorB
NullPointerExceptionC
NumberFormatExceptionD
IllegalArgumentExceptionE
ExceptionlnlnitializerError
考题
单选题You work as an application developer at Certkiller .com. You have recently created a custom collection class named ShoppingList for a local supermarket. This custom class will include ShoppinItem objects that have the public properties listed below. * Name * AisleNumber * OnDiscount You are required to enable users of your class to iterate through the ShoppingList collection, and to list each product name and aisle number using the foreach statement.You need to achieve this by declaring the appropriate code.What code should you use?()A
public class ShoppingList : ICollection {// Class implementation }B
public class ShoppingList : IEnumerator, IEnumerable {// Class implementation }C
public class ShoppingList : Ilist {// Class implementation }D
public class ShoppingList : Enum {// Class implementation }
考题
单选题10. public class ClassA { 11. public void methodA() { 12. ClassB classB = new ClassB(); 13. classB.getValue(); 14. } 15. } And: 20. class ClassB { 21. public ClassC classC; 22. 23. public String getValue() { 24. return classC.getValue(); 25. } 26. } And: 30. class ClassC { 31. public String value; 32. 33. public String getValue() { 34. value = “ClassB”; 35. return value; 36. } 37. } Given: ClassA a = new ClassA(); a.methodA(); What is the result?()A
Compilation fails.B
ClassC is displayed.C
The code runs with no output.D
An exception is thrown at runtime.
考题
单选题10. class Nav{ 11. public enum Direction { NORTH, SOUTH, EAST, WEST } 12. } 13. public class Sprite{ 14. // insert code here 15. } Which code, inserted at line 14, allows the Sprite class to compile?()A
Direction d = NORTH;B
Nav.Direction d = NORTH;C
Direction d = Direction.NORTH;D
Nav.Direction d = Nav.Direction.NORTH;
考题
单选题class Parent { String one, two; public Parent(String a, String b){ one = a; two = b; } public void print(){ System.out.println(one); } } public class Child extends Parent { public Child(String a, String b){ super(a,b); } public void print(){ System.out.println(one + " to " + two); } public static void main(String arg[]){ Parent p = new Parent("south", "north"); Parent t = new Child("east", "west"); p.print(); t.print(); } } Which of the following is correct?()A
Cause error during compilation. B
south east C
south to north east to west D
south to north east E
south east to west
考题
单选题定义枚举如下: public enum Direction{ EAST,SOUTH,WEST,NORTH } 下列正确使用该枚举类型的语句是哪项?()A
Direction Direction=EAST;B
Direction direction=Direction.WEST;C
int a- Direction.NORTH;D
Direction direction=2;
考题
多选题10. abstract public class Employee { 11. protected abstract double getSalesAmount(); 12. public double getCommision() { 13. return getSalesAmount() * 0.15; 14. } 15. } 16. class Sales extends Employee { 17. // insert method here 18. } Which two methods, inserted independently at line 17, correctly complete the Sales class?()Adouble getSalesAmount() { return 1230.45; }Bpublic double getSalesAmount() { return 1230.45; }Cprivate double getSalesAmount() { return 1230.45; }Dprotected double getSalesAmount() { return 1230.45; }
热门标签
最新试卷