网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
11. double input = 314159.26; 12. NumberFormat nf= NumberFormat.getInstance(Locale.ITALIAN); 13. String b; 14. //insert code here Which code, inserted at line 14, sets the value of b to 3 14.159,26?()
- A、 b = nf.parse( input);
- B、 b = nf.format( input);
- C、 b = nf.equals( input);
- D、 b = nf.parseObject( input);
参考答案
更多 “ 11. double input = 314159.26; 12. NumberFormat nf= NumberFormat.getInstance(Locale.ITALIAN); 13. String b; 14. //insert code here Which code, inserted at line 14, sets the value of b to 3 14.159,26?() A、 b = nf.parse( input);B、 b = nf.format( input);C、 b = nf.equals( input);D、 b = nf.parseObject( input);” 相关考题
考题
Whichcode,insertedatline14,setsthevalueofbto314.159,26?()
A.b=nf.parse(input);B.b=nf.format(input);C.b=nf.equals(input);D.b=nf.parseObject(input);
考题
doubleinput=314159.26;12.NumberFormatnf=NumberFormat.getInstance(Locale.ITALIAN);13.Stringb;14.//insertcodehereWhichcode,insertedatline14,setsthevalueofbto314.159,26?()
A.b=nf.parse(input);B.b=nf.format(input);C.b=nf.equals(input);D.b=nf.parseObject(input);
考题
Given:11.doubleinput=314159.26;12.NumberFormatnf=NumberFormat.getInstance(Locale.ITALIAN);13.Stringb;14.//insertcodehereWhichcode,insertedatline14,setsthevalueofbto314.159,26?()
A.b=nf.parse(input);B.b=nf.format(input);C.b=nf.equals(input);D.b=nf.parseObject(input);
考题
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();
考题
11. public class Counter { 12. public static void main(String[] args) { 13. int numArgs = /* insert code here */; 14. } 15. } and the command line: java Counter one fred 42 Which code, inserted at line 13, captures the number of arguments passed into the program?() A、 args.countB、 args.lengthC、 args.count()D、 args.length()E、 args.getLength()
考题
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;
考题
Given: 10.public void service(ServletRequest request, 11.ServletResponse response) { 12.ServletInputStream sis = 13.// insert code here 14.} Which retrieves the binary input stream on line 13?()A、request.getWriter();B、request.getReader();C、request.getInputStream();D、request.getResourceAsStream();
考题
11. public interface Status { 12. /* insert code here */ int MY_VALUE = 10; 13. } Which three are valid on line 12?()A、 finalB、 staticC、 nativeD、 publicE、 privateF、 abstractG、 protected
考题
10. interface Foo {} 11. class Alpha implements Foo {} 12. class Beta extends Alpha {} 13. class Delta extends Beta { 14. public static void main( String[] args) { 15. Beta x = new Beta(); 16. // insert code here 17. } 18. } Which code, inserted at line 16, will cause a java.lang.ClassCastException?() A、 Alpha a = x;B、 Foo f= (Delta)x;C、 Foo f= (Alpha)x;D、 Beta b = (Beta)(Alpha)x;
考题
11. String test = “Test A. Test B. Test C.”; 12. // insert code here 13. String[] result = test.split(regex); Which regular expression inserted at line 12 will correctly split test into “Test A,” “Test B,” and “Test C”?()A、 String regex = “”;B、 String regex = “ “;C、 String regex = “.*“.D、 String regex = “//s”E、 String regex = “//.//s*”;F、 String regex = “//w[ /.] +“;
考题
11. rbo = new ReallyBigObject(); 12. // more code here 13. rbo = null; 14. /* insert code here */ Which statement should be placed at line 14 to suggest that the virtual machine expend effort toward recycling the memory used by the object rbo?() A、 System.gc();B、 Runtime.gc();C、 System.freeMemory();D、 Runtime.getRuntime().growHeap();E、 Runtime.getRuntime().freeMemory();
考题
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: 11.double input = 314159.26; 12.NumberFormat nf = NumberFormat.getInstance(Locale.ITALIAN); 13.String b; 14.//insert code here Which code, inserted at line 14, sets the value of b to 314.159,26?()A、b = nf.parse( input );B、b = nf.format( input );C、b = nf.equals( input );D、b = nf.parseObject( input );
考题
Given: 12. NumberFormat nf = NumberFormat.getInstance(); 13. nf.setMaximumFractionDigits(4); 14. nf.setMinimumFractionDigits(2); 15. String a = nf.format(3.1415926); 16. String b = nf.format(2); Which two statements are true about the result if the default locale is Locale.US?()A、 The value of b is 2.00.B、 The value of a is 3.141.C、 The value of a is 3.14.D、 The value of b is 2.0000.E、 The value of a is 3.1415.F、 The value of a is 3.1416.G、 The value of b is 2.
考题
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 */ }
考题
多选题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?()Apublic void foo() { /* more code here */ }Bprivate void foo() { /* more code here */ }Cprotected void foo() { /* more code here */ }Dint foo() { /* more code here */ }Evoid foo() { /* more code here */ }
考题
单选题10. interface Foo {} 11. class Alpha implements Foo {} 12. class Beta extends Alpha {} 13. class Delta extends Beta { 14. public static void main( String[] args) { 15. Beta x = new Beta(); 16. // insert code here 17. } 18. } Which code, inserted at line 16, will cause a java.lang.ClassCastException?()A
Alpha a = x;B
Foo f= (Delta)x;C
Foo f= (Alpha)x;D
Beta b = (Beta)(Alpha)x;
考题
单选题11. String test = “Test A. Test B. Test C.”; 12. // insert code here 13. String[] result = test.split(regex); Which regular expression inserted at line 12 will correctly split test into “Test A,” “Test B,” and “Test C”?()A
String regex = “”;B
String regex = “ “;C
String regex = “.*“.D
String regex = “//s”E
String regex = “//.//s*”;F
String regex = “//w[ /.] +“;
考题
单选题11. public class Counter { 12. public static void main(String[] args) { 13. int numArgs = /* insert code here */; 14. } 15. } and the command line: java Counter one fred 42 Which code, inserted at line 13, captures the number of arguments passed into the program?()A
args.countB
args.lengthC
args.count()D
args.length()E
args.getLength()
考题
单选题11. rbo = new ReallyBigObject(); 12. // more code here 13. rbo = null; 14. /* insert code here */ Which statement should be placed at line 14 to suggest that the virtual machine expend effort toward recycling the memory used by the object rbo?()A
System.gc();B
Runtime.gc();C
System.freeMemory();D
Runtime.getRuntime().growHeap();E
Runtime.getRuntime().freeMemory();
考题
多选题Given: 11. // insert code here 12. private N min, max; 13. public N getMin() { return min; } 14. public N getMax() { return max; } 15. public void add(N added) { 16. if (min == null || added.doubleValue() max.doubleValue()) 19. max = added; 20. } 21. } Which two, inserted at line 11, will allow the code to compile?()AABBCCDDEEFF
考题
单选题Given: 11.double input = 314159.26; 12.NumberFormat nf = NumberFormat.getInstance(Locale.ITALIAN); 13.String b; 14.//insert code here Which code, inserted at line 14, sets the value of b to 314.159,26?()A
b = nf.parse( input );B
b = nf.format( input );C
b = nf.equals( input );D
b = nf.parseObject( input );
考题
单选题11. double input = 314159.26; 12. NumberFormat nf= NumberFormat.getInstance(Locale.ITALIAN); 13. String b; 14. //insert code here Which code, inserted at line 14, sets the value of b to 3 14.159,26?()A
b = nf.parse( input);B
b = nf.format( input);C
b = nf.equals( input);D
b = nf.parseObject( input);
考题
单选题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();
考题
多选题Given: 12. NumberFormat nf = NumberFormat.getInstance(); 13. nf.setMaximumFractionDigits(4); 14. nf.setMinimumFractionDigits(2); 15. String a = nf.format(3.1415926); 16. String b = nf.format(2); Which two statements are true about the result if the default locale is Locale.US?()AThe value of b is 2.00.BThe value of a is 3.141.CThe value of a is 3.14.DThe value of b is 2.0000.EThe value of a is 3.1415.FThe value of a is 3.1416.GThe value of b is 2.
考题
单选题Given: 11.double input = 314159.26; 12.NumberFormat nf = NumberFormat.getInstance(Locale.ITALIAN); 13.String b; 14.//insert code here Which code, inserted at line 14, sets the value of b to 314.159,26?()A
b = nf.parse( input );B
b = nf.format( input );C
b = nf.equals( input );D
b = nf.parseObject( input );
考题
多选题11. public interface Status { 12. /* insert code here */ int MY_VALUE = 10; 13. } Which three are valid on line 12?()AfinalBstaticCnativeDpublicEprivateFabstractGprotected
热门标签
最新试卷