+ 3
Help me solve this code problem?
Suggest what wrong did i did? https://code.sololearn.com/cifL927BZ1LA/?ref=app
4 ответов
+ 5
First you have to define the type you wanna insert to the arraylist like this:
ArrayList <Integer> list = new ArrayList <Integer>(Here you can choose the size, but you can leave it empty);
Here is the fixed code and look at the comment I added:
https://code.sololearn.com/cKfte7vulSKk/?ref=app
+ 2
Piyush Srivastava Ur welcome
+ 2
There is nothing wrong with your code if you want to remove any number that is less than 3 or greater than 6 and || Will work for that, but if you are using && operator then there is no need to use iterator because your condition is going to be false always and hence nothing will be removed from the list
+ 1
Thanks Eliya