exam questions

Exam 1z0-809 All Questions

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

Exam 1z0-809 topic 1 question 1 discussion

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

Given the definition of the Vehicle class:
Class Vehhicle {
int distance; //line n1
Vehicle (int x) {
this distance = x;
}
public void increSpeed(int time) { //line n2
int timeTravel = time; //line n3
class Car {
int value = 0;
public void speed () {
value = distance /timeTravel;
System.out.println ("Velocity with new speed"+value+"kmph");
}
}
new Car().speed();
}
}
and this code fragment:
Vehicle v = new Vehicle (100);
v.increSpeed(60);
What is the result?

Velocity with new speed -

  • A. line n1.
  • B. A compilation error occurs at line n2.
  • C. A compilation error occurs at line n3.
  • D. A compilation error occurs at
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
Ritesh_
Highly Voted 3 years, 2 months ago
Answer is "Velocity with new speed1kmph"
upvoted 12 times
...
WilsonKKerll
Most Recent 9 months, 1 week ago
Answer is Velocity with new speed1kmph.
upvoted 1 times
...
rameasy
2 years, 4 months ago
I meant "Velocity with new speed1kmph"
upvoted 1 times
...
rameasy
2 years, 4 months ago
Ans: A
upvoted 1 times
...
Innovation
2 years, 11 months ago
No compilation error occurs
upvoted 2 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 ...