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.



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

Answer / 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

More Core Java Interview Questions

Explain the difference between transient and volatile in java?

0 Answers  


What is mnemonic code?

0 Answers  


Difference between collection, collection and collections in java?

0 Answers  


What are "methods" and "fields"?

0 Answers   Wipro,


What are the Object and Class that classes used for?

3 Answers   Mphasis,


What is the return type of readLine() when end of a file is reached?

2 Answers  


what do you mean by classloader in java?

0 Answers  


how are methods defined?

0 Answers  


Differences between jdk 1.4 and 1.5

6 Answers   SoftSol, TCS, Wipro,


how to handle http request in struts

2 Answers   Polaris,


What is the difference between Array and Hash Table?

0 Answers   Impetus,


Is vector synchronized in java?

0 Answers  


Categories