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 the purpose of java?
how many ways to create Thread and which one is good? runnable interface ot Thread class?
Why there are some null interface in JAVA? What does it mean? Give some null interface in JAVA?
give me the answer of this code class A extnds String This code we can write r not in Java? Explain?
What is the root class for all Java classes?
how to compile jsp?
What is 'finally' method in Exceptions?
Can constructor be synchronized?
What is the main use of java?
Explain about strings in java?
What is the life cycle of an Applet ?
What is size of int in java?