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 passing value java?
What is diamond operator in java?
Explain inheritance in java?
Why local variables are stored in stack?
What are the allowed, non-Unicode letter characters that can be used as the first character of an identifier?
What is meant by inheritance and what are its advantages?
What is loop in java?
How do you calculate square roots?
When to use runnable interface vs thread class in java?
What is static synchronization?
What does substring mean?
What are the different types of sorting in java?