What is the result?

Given:


and this code fragment:
Set<Vehicle> vehicles = new TreeSet <> ();
vehicles.add(new Vehicle (10123, “Ford”));
vehicles.add(new Vehicle (10124, “BMW”));
System.out.println(vehicles);
What is the result?
A. 10123 Ford
10124 BMW
B. 10124 BMW
10123 Ford
C. A compilation error occurs.
D. A ClassCastException is thrown at run time.

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.