Q) I have a ArrayList object, in that object i have added 5
integer values, 5 float values, 5 string values. Now
question is how can delete particular type of data ( i.e all
int values or all float values or string values) in that
list object at a time?
Answer Posted / murli
for(int i=0;i<arr.size();i++){
if(arr.get(i) instanceof Integer)
arr.remove(i);
}
| Is This Answer Correct ? | 5 Yes | 4 No |
Post New Answer View All Answers
how does multithreading take place on a computer with a single cpu? : Java thread
How do you clear an arraylist in java?
Why java is a platform independent? Explain
What are packages in java?
What is unsigned char?
Explain the difference between abstract classes and interfaces in java?
What is nested interface?
What is difference between overloading and overriding in java?
When parseint method can be used?
write a program that list all permutations of ABCDEF in which A appears before B?
What is meant by nested loop?
What is lambda expression in java?
Highest level event class of the event-delegation model?
what is meant by abstract class?
can I implement my own start() method? : Java thread