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

Can we create a constructor in abstract class?

0 Answers  


Can finally block be used without a catch?

0 Answers  


What is the difference between choice and list?

0 Answers  


Is it possible to write static method in abstract class? justyfy your answer?

5 Answers   Hexaware,


Explain the differences between public, private, protected and static?

4 Answers  


Can i have abstract class with no abstract methods?

22 Answers   CTS,


What is sortedmap interface?

0 Answers  


Hi Friends, can you give difference between extending thread class and implementing runnable interface.

4 Answers  


Why we go for collections in java?

0 Answers  


Can we call thread start () twice?

0 Answers  


What are class types in java?

0 Answers  


What are the two main uses of volatile in Java?

0 Answers  


Categories