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

how does multithreading take place on a computer with a single cpu? : Java thread

1198


How do you clear an arraylist in java?

1018


Why java is a platform independent? Explain

1153


What are packages in java?

1779


What is unsigned char?

1128


Explain the difference between abstract classes and interfaces in java?

1258


What is nested interface?

1049


What is difference between overloading and overriding in java?

1071


When parseint method can be used?

985


write a program that list all permutations of ABCDEF in which A appears before B?

2515


What is meant by nested loop?

1084


What is lambda expression in java?

1104


Highest level event class of the event-delegation model?

4064


what is meant by abstract class?

1181


can I implement my own start() method? : Java thread

1036