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 do heavy weight components mean in java programming?
What is the difference between this() and super()?
What is polymorphism in java? What are the kinds of polymorphism?
Why Static variable required in java?For ex,class A { static int a; int b; } Why static is required?
How many bits is a string?
What are the fileinputstream and fileoutputstream?
String and stringbuffer both represent string objects. Can we compare string and stringbuffer in java?
What an i/o filter?
Is double bigger than float?
What do you understand by overloading and overriding in java?
How do you represent a space in regex java?
What is the declaration statement?