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 are the benefits of java?

1146


Explain the difference between protected and default access.

1011


Why wait(),notify(),notifyAll() methods defined in Object class althought we are using in only threads.

2832


What is the difference between serializable and externalizable interface?

1114


Is char * a string?

999


What is the difference between a scrollbar and a scrollpane?

1066


When is the arraystoreexception thrown?

1036


Which is dependent variable?

908


why not override thread to make a runnable? : Java thread

1013


What is the difference between double and float variables in java?

1167


List the three steps for creating an object for a class?

977


what is meant by Garbage collection?

1104


Can we pass null as argument in java?

970


Explain implementation and how is it different from conversion?

1095


How many arguments can be passed to main ()?

1005