What is the result?

Given the content of /resourses/Message.properties:
welcome1=”Good day!”
and given the code fragment:
Properties prop = new Properties ();
FileInputStream fis = new FileInputStream (“/resources/Message.properties”); prop.load(fis);
System.out.println(prop.getProperty(“welcome1”));
System.out.println(prop.getProperty(“welcome2”, “Test”));//line n1
System.out.println(prop.getProperty(“welcome3”));
What is the result?
A. Good day!
Test
followed by an Exception stack trace
B. Good day!
followed by an Exception stack trace
C. Good day!
Test null
D. A compilation error occurs at line n1.

Download Printable PDF. VALID exam to help you PASS.

4 thoughts on “What is the result?

Leave a Reply

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


The reCAPTCHA verification period has expired. Please reload the page.