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 |
Explain the difference between transient and volatile in java?
What is mnemonic code?
Difference between collection, collection and collections in java?
What are "methods" and "fields"?
What are the Object and Class that classes used for?
What is the return type of readLine() when end of a file is reached?
what do you mean by classloader in java?
how are methods defined?
Differences between jdk 1.4 and 1.5
6 Answers SoftSol, TCS, Wipro,
how to handle http request in struts
What is the difference between Array and Hash Table?
Is vector synchronized in java?