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...

write a program to create an arraylist and listeterator.and
value should be enter through keyboard.

Answer Posted / magreal

public static void main(String[] args) {

String str;
List<String> l = new ArrayList();
int i=0;
boolean more = true;
do{
str = TextIO.getln();
l.add(str);
i++;
TextIO.putln("Add new item ? Y/N");
}while(TextIO.getlnBoolean());

for(String s: l){
TextIO.putln(s);
}
}

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is java lang object?

932


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

939


What the difference is between execute, execute Query, execute Update?

778


What is the difference between hashmap and hashtable? What is an interface?

1087


What are the main uses of the super keyword?

927


What does snprintf return?

958


What is off heap memory?

941


Is the milky way in a void?

925


What does jenkins do?

874


How many types of operators are there?

934


What are the advantages of inner classes?

960


What is a finally block? Is there a case when finally will not execute?

1005


Explain the use of volatile field modifier?

1033


State some situations where exceptions may arise in java?

1005


Why for each loop is used?

969