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

What is passing value java?

0 Answers  


What is diamond operator in java?

0 Answers  


Explain inheritance in java?

0 Answers  


Why local variables are stored in stack?

0 Answers  


What are the allowed, non-Unicode letter characters that can be used as the first character of an identifier?

2 Answers  


What is meant by inheritance and what are its advantages?

0 Answers  


What is loop in java?

0 Answers  


How do you calculate square roots?

0 Answers  


When to use runnable interface vs thread class in java?

0 Answers  


What is static synchronization?

0 Answers  


What does substring mean?

0 Answers  


What are the different types of sorting in java?

0 Answers  


Categories