write a program to create an arraylist and listeterator.and
value should be enter through keyboard.
Answer Posted / 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 View All Answers
What is java lang object?
can I implement my own start() method? : Java thread
What the difference is between execute, execute Query, execute Update?
What is the difference between hashmap and hashtable? What is an interface?
What are the main uses of the super keyword?
What does snprintf return?
What is off heap memory?
Is the milky way in a void?
What does jenkins do?
How many types of operators are there?
What are the advantages of inner classes?
What is a finally block? Is there a case when finally will not execute?
Explain the use of volatile field modifier?
State some situations where exceptions may arise in java?
Why for each loop is used?