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 the purpose of using the java bean?
Is constructor inherited?
Same common question what is Map,Set,HashMap,List????
What is the use of using enum to declare a constant?
What is lazy activation?
Can we use string in switch case in java?
What are recursive functions? Give some examples?
0 Answers Axtria, ITC Indian Tobacco Company,
Can i have abstract class with no abstract methods?
What do you mean by singleton class in java?
What is method in java ?
How GC (Garbage Collector) knows the objects reference is unused.Whether GC removes the unused object Parmanently or it maintains something.
any other way to print the text without using System.out.println() in java?