Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What does  mean in regex?

984


What is the difference between sleep and wait in java?

897


How many bits is a double?

941


What is methodological framework?

969


If try block is successfully executed, Then Is Finally block executed?

1036


Why is stringbuffer called mutable?

932


State the difference between strings and arrays.

1137


What is synchronization and why is it important in java programming?

882


What are the Static and Dynamic Variables? Differentiate them.

1043


Explain how can you debug the Java code?

1000


Give me an example of array and linked list? Where they can be used?

953


Why 1 is not a prime number?

978


What are assembly attributes?

947


What is anagram in java?

862


What is use of static in java?

1086