5 AnswersNew Answer
Oleg Storm The main problem with your code is that you are using '==' operator to compare the user input with carModel when you should be using '.equals()' function to compare them. To quote GeeksforGeeks - "== checks if both objects point to the same memory location whereas .equals() evaluates to the comparison of values in the objects." https://www.geeksforgeeks.org/difference-equals-method-java/ If you want your code to print the price of the car if the user entered the correct car model then you need to replace "System.out.println(car.CarModel(model));" with "System.out.println(car.Price());" This should get back on track. Let me know either way.
I really didn't know what this (==) means till now🤤, it was so helpful! Thanks a lot for your answer, ODLNT😄.
https://code.sololearn.com/cEEYRbnnBdCv/?ref=app My ultimate thanks to you, guys😊