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 core java used for?

1107


How do you break a loop?

975


What are void pointers?

1293


What access modifiers can be used for methods?

1093


how we can make a read-only class in java?

981


What is t in generics in java?

1058


What is the Concept of Encapsulation in OOPS

990


What are the two environment variables that must be set in order to run any java programs?

958


What does substring mean?

971


What do you mean by default constructor in java?

1058


Can we assign integer value to char in java?

1020


What is scope & storage allocation of global and extern variables? Explain with an example

1029


What is merge sort in java?

962


Realized?

2176


What is the difference between ArrayList and Vector? which one is better in Java

1119