多选题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: 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.
参考解析
解析:
暂无解析
相关考题:
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);
NumberFormatnf=NumberFormat.getInstance();nf.setMaximumFractionDigits(4);nf.setMinimumFractionDigits(2);Stringa=nf.format(3.1415926);Stringb=nf.format(2);WhichtwoaretrueabouttheresultifthedefaultlocaleisLocale.US?()A.Thevalueofbis2.B.Thevalueofais3.14.C.Thevalueofbis2.00.D.Thevalueofais3.141.E.Thevalueofais3.1415.F.Thevalueofais3.1416.G.Thevalueofbis2.0000.
Given:12.NumberFormatnf=NumberFormat.getInstance();13.nf.setMaximumFractionDigits(4);14.nf.setMinimumFractionDigits(2);15.Stringa=nf.format(3.1415926);16.Stringb=nf.format(2);WhichtwostatementsaretrueabouttheresultifthedefaultlocaleisLocale.US?()A.Thevalueofbis2.00.B.Thevalueofais3.141.C.Thevalueofais3.14.D.Thevalueofbis2.0000.E.Thevalueofais3.1415.F.Thevalueofais3.1416.G.Thevalueofbis2.
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);
11. public class Commander { 12. public static void main(String[] args) { 13. String myProp = /* insert code here */ 14. System.out.println(myProp); 15. } 16. } and the command line: java -Dprop.custom=gobstopper Commander Which two, placed on line 13, will produce the output gobstopper?()A、 System.load(”prop.custom”);B、 System.getenv(”prop.custom”);C、 System.property(”prop.custom”);D、 System.getProperty(”prop.custom”);E、 System.getProperties().getProperty(”prop.custom”);
1. class TestA { 2. TestB b; 3. TestA() { 4. b = new TestB(this); 5. } 6. } 7. class TestB { 8. TestA a; 9. TestB(TestA a) { 10. this.a = a; 11. } 12. } 13. class TestAll { 14. public static void main (String args[]) { 15. new TestAll().makeThings(); 16. // ...code continues on 17. } 18. void makeThings() { 19. TestA test = new TestA(); 20. } 21. } Which two statements are true after line 15, before main completes?()A、 Line 15 causes a stack overflow.B、 An exception is thrown at runtime.C、 The object referenced by a is eligible for garbage collection.D、 The object referenced by b is eligible for garbage collection.E、 The object referenced by a is not eligible for garbage collection.F、 The object referenced by b is not eligible for garbage collection.
11. public void testIfA() { 12. if(testIfB(”True”)) { 13. System.out.println(”True”); 14. } else { 15. System.out.println(”Not true”); 16. } 17. } 18. public Boolean testIfB(String str) { 19. return Boolean.valueOf(str); 20. } What is the result when method testIfA is invoked?() A、 TrueB、 Not trueC、 An exception is thrown at runtime.D、 Compilation fails because of an error at line 12.E、 Compilation fails because of an error at line 19.
11. class Converter { 12. public static void main(String[] args) { 13. Integer i = args[0]; 14. int j = 12; 15. System.out.println(”It is “ + (j==i) + “that j==i.”); 16. } 17. } What is the result when the programmer attempts to compile the code and run it with the command java Converter 12?() A、 It is true that j==i.B、 It is false that j==i.C、 An exception is thrown at runtime.D、 Compilation fails because of an error in line 13.
11. class Animal { public String noise() { return “peep”; } } 12. class Dog extends Animal { 13. public String noise() { return “bark”; } 14. } 15. class Cat extends Animal { 16. public String noise() { return “meow”; } 17. } ..... 30. Animal animal = new Dog(); 31. Cat cat = (Cat)animal; 32. System.out.printIn(cat.noise()); What is the result?() A、 peepB、 barkC、 meowD、 Compilation fails.E、 An exception is thrown at runtime.
NumberFormat nf= NumberFormat.getInstance(); nf.setMaximumFractionDigits(4); nf.setMinimumFractionDigits(2); String a = nf.format(3.1415926); String b = nf.format(2); Which two are true about the result if the default locale is Locale.US?()A、 The value of b is 2.B、 The value of a is 3.14.C、 The value of b is 2.00.D、 The value of a is 3.141.E、 The value of a is 3.1415.F、 The value of a is 3.1416.G、 The value of b is 2.0000.
1. class A { 3. public String to String() { 4. return “4”; 5. } 6. } 7. class B extends A { 8. public String toString() { 9. return super.toString() + “3”; 10. } 11. } 12. public class Test { 13. public static void main (String[] args) { 14. System.out.printIn(new B()); 15. } 16. } What is the result( )? A、 Compilation succeeds and 4 is printed.B、 Compilation …………… is printed.C、 An error on line 9 cause compilation to fail.D、 An error on line 14 cause compilation to fail.E、 Compilation succeeds but an exception is thrown at line 9.
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. public class MyClass { 11. 12. public Integer startingI; 13. public void methodA() { 14. Integer i = new Integer(25); 15. startingI = i; 16. methodB(i); 17. } 18. private void methodB(Integer i2) { 19. i2 = i2.intValue(); 20. 21. } 22. } If methodA is invoked, which two are true at line 20?()A、 i2 == startingI returns true.B、 i2 == startingI returns false.C、 i2.equals(startingI) returns true.D、 i2.equals(startingI) returns false.
11. public static void test(String str) { 12. if(str == null | str.lellgth() == 0) { 13. System.out.println(”String is empty”); 14. } else { 15. System.out.println(”String is not empty”); 16. } 17. } And the invocation: 31. test(llull); What is the result?() A、 Au exception is thrown at runtime.B、 “String is empty” is printed to output.C、 Compilation fails because of au error in line 12.D、 “String is not empty” is printed to output.
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: 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?()Ab = nf.parse( input );Bb = nf.format( input );Cb = nf.equals( input );Db = nf.parseObject( input );
单选题11. public void testIfA() { 12. if(testIfB(”True”)) { 13. System.out.println(”True”); 14. } else { 15. System.out.println(”Not true”); 16. } 17. } 18. public Boolean testIfB(String str) { 19. return Boolean.valueOf(str); 20. } What is the result when method testIfA is invoked?()A TrueB Not trueC An exception is thrown at runtime.D Compilation fails because of an error at line 12.E Compilation fails because of an error at line 19.
多选题1. class TestA { 2. TestB b; 3. TestA() { 4. b = new TestB(this); 5. } 6. } 7. class TestB { 8. TestA a; 9. TestB(TestA a) { 10. this.a = a; 11. } 12. } 13. class TestAll { 14. public static void main (String args[]) { 15. new TestAll().makeThings(); 16. // ...code continues on 17. } 18. void makeThings() { 19. TestA test = new TestA(); 20. } 21. } Which two statements are true after line 15, before main completes?()ALine 15 causes a stack overflow.BAn exception is thrown at runtime.CThe object referenced by a is eligible for garbage collection.DThe object referenced by b is eligible for garbage collection.EThe object referenced by a is not eligible for garbage collection.FThe object referenced by b is not eligible for garbage collection.
单选题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);
单选题Given: 11. public static void main(String[] args) { 12. Object obj = new int[] { 1, 2, 3 }; 13. int[] someArray = (int[])obj; 14. for (int i : someArray) System.out.print(i + " "); 15. } What is the result? ()A Compilation fails because of an error in line 13.B A ClassCastException is thrown at runtime.C 1 2 3D Compilation fails because of an error in line 14.E Compilation fails because of an error in line 12.
单选题11. class Animal { public String noise() { return “peep”; } } 12. class Dog extends Animal { 13. public String noise() { return “bark”; } 14. } 15. class Cat extends Animal { 16. public String noise() { return “meow”; } 17. } ..... 30. Animal animal = new Dog(); 31. Cat cat = (Cat)animal; 32. System.out.printIn(cat.noise()); What is the result?()A peepB barkC meowD Compilation fails.E An exception is thrown at runtime.
单选题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?()Ab = nf.parse( input );Bb = nf.format( input );Cb = nf.equals( input );Db = nf.parseObject( input );
多选题11. public class Commander { 12. public static void main(String[] args) { 13. String myProp = /* insert code here */ 14. System.out.println(myProp); 15. } 16. } and the command line: java -Dprop.custom=gobstopper Commander Which two, placed on line 13, will produce the output gobstopper?()ASystem.load(”prop.custom”);BSystem.getenv(”prop.custom”);CSystem.property(”prop.custom”);DSystem.getProperty(”prop.custom”);ESystem.getProperties().getProperty(”prop.custom”);
多选题NumberFormat nf= NumberFormat.getInstance(); nf.setMaximumFractionDigits(4); nf.setMinimumFractionDigits(2); String a = nf.format(3.1415926); String b = nf.format(2); Which two are true about the result if the default locale is Locale.US?()AThe value of b is 2.BThe value of a is 3.14.CThe value of b is 2.00.DThe value of a is 3.141.EThe value of a is 3.1415.FThe value of a is 3.1416.GThe value of b is 2.0000.
多选题10. public class MyClass { 11. 12. public Integer startingI; 13. public void methodA() { 14. Integer i = new Integer(25); 15. startingI = i; 16. methodB(i); 17. } 18. private void methodB(Integer i2) { 19. i2 = i2.intValue(); 20. 21. } 22. } If methodA is invoked, which two are true at line 20?()Ai2 == startingI returns true.Bi2 == startingI returns false.Ci2.equals(startingI) returns true.Di2.equals(startingI) returns false.