The value of b is 2.00.
The value of a is 3.141.
The value of a is 3.14.
The value of b is 2.0000.
The value of a is 3.1415.
The value of a is 3.1416.
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.
第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?()
第3题:
A.b=nf.parse(input);
B.b=nf.format(input);
C.b=nf.equals(input);
D.b=nf.parseObject(input);
第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?()
第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?()
第6题:
A.b=nf.parse(input);
B.b=nf.format(input);
C.b=nf.equals(input);
D.b=nf.parseObject(input);
第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?()
第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.
第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?()
第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?()