Sorry to bug u all again and again | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Sorry to bug u all again and again

But sololearn is the only plateform i trust to clear my doubts. The error says- Objects cannot be converted to Integer Thank you in advance. https://code.sololearn.com/c5fvDv0E8GfH/?ref=app How to remove the error

7th Sep 2020, 8:31 AM
stephen haokip
stephen haokip - avatar
3 Answers
+ 3
Again as yesterday, you haven't provided any types to the Lists And when you have multiple types of data to be passed you can use Object as well, you can create custom Object which can take multiple type of values. https://code.sololearn.com/c6o8506RFqq5/?ref=app
7th Sep 2020, 8:45 AM
Мг. Кнап🌠
Мг. Кнап🌠 - avatar
0
Done
7th Sep 2020, 8:35 AM
stephen haokip
stephen haokip - avatar
0
list.add(0, new Object()); by this, what are trying stephen haokip ? List you declared as Integer type so it can add only Integer values.. If you trying to do so add like list.add(0, i); // i an example... Instead of that line add this.
7th Sep 2020, 8:40 AM
Jayakrishna 🇮🇳