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 the purpose of using the java bean?

0 Answers  


Is constructor inherited?

0 Answers  


Same common question what is Map,Set,HashMap,List????

4 Answers   Symphony,


What is the use of using enum to declare a constant?

0 Answers   Fidelity,


What is lazy activation?

2 Answers   CMC,


Can we use string in switch case in java?

0 Answers  


What are recursive functions? Give some examples?

0 Answers   Axtria, ITC Indian Tobacco Company,


Can i have abstract class with no abstract methods?

22 Answers   CTS,


What do you mean by singleton class in java?

0 Answers  


What is method in java ?

0 Answers  


How GC (Garbage Collector) knows the objects reference is unused.Whether GC removes the unused object Parmanently or it maintains something.

2 Answers  


any other way to print the text without using System.out.println() in java?

5 Answers   IBM, Infosys,


Categories