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 a package in java? List down various advantages of packages.
what are the methods of an object class?
Name some OOPS Concepts in Java?
What restrictions are placed on method overloading?
Explain the purpose of garbage collection in Java?
what is a thread pool in java and why is it used?
How many wrapper classes are there in java?
what is the Use of throws exception?
What is a methodologist?
What is the method in java?
Class c implements interface I containing method m1 and m2 declarations. Class c has provided implementation for method m2. Can I create an object of class c?
What is the char data type?