多选题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 resul

题目
多选题
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.

如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

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.


参考答案:A, F

第2题:

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”);

正确答案:D,E

第3题:

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);


参考答案:B

第4题:

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、 peep
  • B、 bark
  • C、 meow
  • D、 Compilation fails.
  • E、 An exception is thrown at runtime.

正确答案:E

第5题:

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、 True
  • B、 Not true
  • C、 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.

正确答案:A

第6题:

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);


参考答案:B

第7题:

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.

正确答案:C,D

第8题:

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.


参考答案:C, F

第9题:

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.

正确答案:D

第10题:

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.

正确答案:C,F

更多相关问题