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
Why volatile is used in java?
When can you say a graph to be a tree?
Is string is a keyword in java?
Is java free for businesses?
Can a variable be local and static at the same time?
What is a method vs function?
Print Vertical traversal of a Binary Tree.
What is instance synchronization?
Can inner class final?
Which is the best sorting technique in java?
Can subclass overriding method declare an exception if parent class method doesn't throw an exception?
What are the concepts of 'OOPS'?
How to create a custom exception?
We are seeing so many videos/audios as many web sited. But question is these videos or audios are stored in Databases ( Oracle, Mysql, Sybase,... ) or stored any file directory from there they will give the link for that? Pls explain and give sample code to achieve this one? Thanks, Seenu.
What is a java developer salary?