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 serialization in java?

1063


How to stop a thread in java? Explain about sleep () method in a thread?

1015


What is the benefit of lambda expressions?

1066


How are destructors defined in java?

1038


What is the output of the below java program?

1048


Explain about anonymous inner classes in java?

1090


What is the this keyword?

1033


How many bits are used to represent unicode, ascii, utf-16, and utf-8 characters in java programming?

1017


What is immutability in java?

1094


Can an interface have a constructor?

974


Is a class subclass of itself?

1090


What causes memory leak in java?

938


Can we override compareto method?

946


What is try-with-resources in java?

1174


What are reference variables in java?

1129