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 meant by 'bit masking' in java?

0 Answers   DELL,


What is the difference between a scrollbar and a scrollpane?

0 Answers  


Difference between process and thread?

0 Answers   HP,


Is 'null' a keyword?

8 Answers  


Detail discussions on JVM, memory management and garbage collector.

0 Answers   Expedia,


Is java jre still free?

0 Answers  


Write a function to print Fibonacci series and Tribonacci series?

0 Answers   Hexaware,


What is the primary benefit of encapsulation?

0 Answers  


Is there any tag in htm to upload and download files?

0 Answers  


What is meant by bytecode?

0 Answers  


What are the Memory Allocations available in JavaJava?

1 Answers  


Explain about assignment statement?

0 Answers  


Categories