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 the final class modifier?
What is a nonetype?
What is a function in programming?
Why does the integer quotient -0/3 yield 0, but the double quotient -0.0/3.0 yields – 0.0?
What is a method in coding?
What is the use of parseint in java?
What is the difference between stringbuffer and stringbuilder class?
Is singleton set an interval?
Why use string handling in Java?
What is locale?
What is a values collection view ?
What are keyboard events?
What is an empirical question?
What are the restrictions imposed on method overriding?
List the features of java programming language.