exam questions

Exam 1z0-809 All Questions

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

Exam 1z0-809 topic 1 question 130 discussion

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

Given the code fragments :
and

What is the result?

  • A. TV Price :110 Refrigerator Price :2100
  • B. A compilation error occurs.
  • C. TV Price :1000 Refrigerator Price :2000
  • D. The program prints nothing.
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

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
steefaand
5 months, 4 weeks ago
Selected Answer: A
A is correct, but there is typo in answer and it should be TV Price :1100
upvoted 1 times
...
lnrdgst
2 years, 2 months ago
The answer is "A". However, there was a typo in the alternatives, it should contain TV Price:1100 Refrigerator Price:2100 instead of TV Price :110 Refrigerator Price :2100
upvoted 2 times
...
Ohayou
2 years, 4 months ago
Answer : A
upvoted 1 times
...
AVB22
2 years, 8 months ago
A is correct TV Price: 1100Refrigerator Price: 2100 class Product { String name; Integer price; Product(String name, Integer price){ this.name = name; this.price = price; } public void printVal() {System.out.print(name + " Price: "+ price);} public void setPrice(int price) {this.price = price;} public Integer getPrice() {return price;} } public class Test { public static void main (String[] args) { List<Product> li = Arrays.asList(new Product ("TV",1000), new Product ("Refrigerator",2000)); Consumer<Product> raise = e->e.setPrice(e.getPrice()+100); li.forEach(raise); li.stream().forEach(Product::printVal); }}
upvoted 4 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