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 |
What is meant by vector class, dictionary class, hash table class, and property class?
What are the traverses in Binary Tree?
How will you compute size of a structure?
Why is prepared Statement, Callable Statement used for? What is the need of Batch updates?
Which browsers work with java?
what is custom tags with example?
Hi buddy, well i got that there is always a default constructor with abstract class. OK. But why not with interface? Thanks in advance.
what is life cycle of applet?
what is the difference between future and callable interface in java?
What is byte value?
Which data type is a class in java?
Suppose there is a System A which gives some output. This output is used as input by system B. The rate at which System A produces is faster than the rate at which system B consumes it. How can you improve this?