1Z0-809 practice question 24 of 25

Given: class Vehicle { int vno; String name; public Vehicle (int vno, String name) { this.vno = vno,; this.name = name; } public String toString () {…

Choose your answer, then check it against the explanation.

Given: class Vehicle { int vno; String name; public Vehicle (int vno, String name) { this.vno = vno,; this.name = name; } public String toString () { return vno + “:” + name; } } and this code fragment: Set vehicles = new TreeSet (); vehicles.add(new Vehicle (10123, “Ford”)); vehicles.add(new Vehicle (10124, “BMW”)); System.out.println(vehicles); What is the result?
Answer options
Question 24 of 25

Keep practicing

Take the free 1Z0-809 practice test

Ten exam-style questions with answers and explanations, plus the exam facts and study guides.

Start the free practice test

More questions

Other 1Z0-809 practice questions

Scroll to Top