exam questions

Exam 1z0-809 All Questions

View all questions & answers for the 1z0-809 exam

Exam 1z0-809 topic 1 question 7 discussion

Actual exam question from Oracle's 1z0-809
Question #: 10
Topic #: 2
[All 1z0-809 Questions]

/resourses/Message.properties:

Given the content of -
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 Exception stack trace followed by an
  • B. Good day! Exception stack trace followed by an
  • C. Good day! Test null line n1.
  • D. A compilation error occurs at
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Ritesh_
Highly Voted 4 years, 9 months ago
It should print . "Good day!" Test null
upvoted 8 times
WilsonKKerll
2 years, 4 months ago
Correct.
upvoted 1 times
...
...
Innovation
Highly Voted 4 years, 6 months ago
Test is given as a defaut value for welcome2 so the output is "Good day!" Test null
upvoted 5 times
...
iSnover
Most Recent 5 months, 4 weeks ago
Selected Answer: C
The answer is A, Test is given as a defaut value for welcome2 so the output is: "Good day!" Test null
upvoted 1 times
...
adnano1234
4 years, 6 months ago
C is correct
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago