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 do heavy weight components mean in java programming?

0 Answers  


What is the difference between this() and super()?

15 Answers   TCS,


What is polymorphism in java? What are the kinds of polymorphism?

0 Answers  


Why Static variable required in java?For ex,class A { static int a; int b; } Why static is required?

5 Answers   Ericsson,


How many bits is a string?

0 Answers  






What are the fileinputstream and fileoutputstream?

0 Answers  


String and stringbuffer both represent string objects. Can we compare string and stringbuffer in java?

0 Answers  


What an i/o filter?

0 Answers  


Is double bigger than float?

0 Answers  


What do you understand by overloading and overriding in java?

0 Answers  


How do you represent a space in regex java?

0 Answers  


What is the declaration statement?

0 Answers  


Categories