Question 28 :
Which code fragment inserted at line 2 of the following code will yield an output of 54,567.68?
Which code fragment inserted at line 2 of the following code will yield an output of 54,567.68?
Choose one answer.
a. numberFormat.setMaximumFractionDigits(2);
b. numberFormat.setFractionDigits(2);
c. numberFormat.setMinimumFractionDigits(2);
d. numberFormat.setDecimalDigits(2);
e. numberFormat.setMaximumDecimalDigits(2);
a. numberFormat.setMaximumFractionDigits(2);
b. numberFormat.setFractionDigits(2);
c. numberFormat.setMinimumFractionDigits(2);
d. numberFormat.setDecimalDigits(2);
e. numberFormat.setMaximumDecimalDigits(2);
Question 29 :
Which of these must be true if you execute the following command?
Choose at least one answer.
a. The definition of the App class must be preceded by the statement 'package hello.my;'
b. The definition of the App class must be preceded by the statement 'package xyz.hello.my;'
c. The definition of the App class must be preceded by the statement 'package my;'
d. App.class must be found in xyz\hello\my directory
e. App.class must be found in xyz\hello directory
f. App.class must be found in xyz directory
a. The definition of the App class must be preceded by the statement 'package hello.my;'
b. The definition of the App class must be preceded by the statement 'package xyz.hello.my;'
c. The definition of the App class must be preceded by the statement 'package my;'
d. App.class must be found in xyz\hello\my directory
e. App.class must be found in xyz\hello directory
f. App.class must be found in xyz directory
Question 30 :
What is the result of compiling and running the following code?
Choose one answer.
a. Code does not compile because class B does not implement Serializable.
b. Code does not compile because class A does not have a no-arguments constructor.
c. Code compiles fine but causes an exception at runtime.
d. Code compiles and runs fine, printing 5.
e. Code compiles and runs fine, printing 2.
a. Code does not compile because class B does not implement Serializable.
b. Code does not compile because class A does not have a no-arguments constructor.
c. Code compiles fine but causes an exception at runtime.
d. Code compiles and runs fine, printing 5.
e. Code compiles and runs fine, printing 2.
<<<Previous Page Next Page >>>