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
Explain the protected field modifier?
What is tcp ip in java?
What is nested top-level class?
What is pass by value?
How many arguments can a method have java?
What is a treeset class?
Is there any sort function in java?
Are floats faster than doubles?
What are the differences between getting and load method?
What is sorting algorithm in java?
What is boolean law?
Is hashset ordered java?
Can we create a class inside a class in java?
What does 0 mean in boolean?
what type of questions asked for barclays technologies pune please send urgent