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 is the use of object and class classes?

1043


How do you input a string in java?

1082


Which is a valid identifier?

1210


What is meant by stack and queue?

1071


Is int a class in java?

985


How can you write a loop indefinitely in java programming?

1029


What is string and example?

1042


If an application has multiple classes in it, is it okay to have a main method in more than one class?

1013


What is the difference between a field variable and a local variable?

1112


Difference between doublesummarystatistics, intsummarystatistics and longsummarystatistics ?

988


What is strings in java?

1044


Why to use nested classes in java? (Or) what is the purpose of nested class in java?

1071


Is string a class in java?

985


What is java util?

1025


Can an integer be a string?

1068