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
What does mean in regex?
What is the difference between sleep and wait in java?
How many bits is a double?
What is methodological framework?
If try block is successfully executed, Then Is Finally block executed?
Why is stringbuffer called mutable?
State the difference between strings and arrays.
What is synchronization and why is it important in java programming?
What are the Static and Dynamic Variables? Differentiate them.
Explain how can you debug the Java code?
Give me an example of array and linked list? Where they can be used?
Why 1 is not a prime number?
What are assembly attributes?
What is anagram in java?
What is use of static in java?