line 27 gives error
i am not able to insert like this
why?
whats wrong in this code?
line 27 gives error
i am not able to insert like this
why?
whats wrong in this code?
@yatin
The problem is not with the map but rather with your class. You have overloaded the default constructor in your class with a parametrised constructor. Always overload the default constructor with normal constructor as well.
That is , update your fruit class with a constructor that takes no arguments.
fruit() {
name = “”;
price = 0;
city = “”;
}
Add this to your class. Then try to run line 27.
ok sir got it
thank you
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.