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 collection interface?

1016


How do you escape sequences in java?

1069


Can we override data members in java?

1136


What do you understand by access specifiers in Java?

1007


List the different types of classloaders in java.

966


How do you check if a string contains only numeric digits?

1115


How do I get a substring?

968


Explain a few methods of overloading best practices in java?

976


How to read and write image from a file ?

1040


How can you make sure that your singleton class will always return single instance in multi-threaded environment?

1016


For class CFoo { }; what default methods will the compiler generate for you>?

1066


What is sorting in java?

984


How to perform binary search in java?

992


Can we make main() thread as daemon?

1094


What is class level lock ?

1022