Which two, placed on line 13, will produce the output gobstopper?

Given:

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? (Choose two.)

Given:

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? (Choose two.)

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



Leave a Reply 0

Your email address will not be published. Required fields are marked *