Need help with boolean and not adding a vehicle with the same identification | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Need help with boolean and not adding a vehicle with the same identification

public boolean hasVehicleIdentificationNumber(String vehicleNumber) Hello, im having a hard time with returning true "Return true if the car lot has a vehicle with the number provided in the inventory" and then return false if not, but i think there is something wrong with my code and i cant seem to figure it out. public void addVehicle(Vehicle theVehicle) How do i not add a vehicle with the same identification? I tried an if statement and foreach but i really dont know what i was doing. https://code.sololearn.com/W6R6J3so6mFf

27th Oct 2019, 4:57 PM
Secr
Secr - avatar
1 Answer
0
I think your main issue is your confusion between Java and JavaScript. They are completely different despite their names. You need to put your code into the Java interpreter on here and try again.
27th Oct 2019, 5:38 PM
Russ
Russ - avatar