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’s the difference between callable and runnable?
What is cloneable interface?
How is object created in java?
What all access modifiers are allowed for top class ?
What is the purpose of setAutoCommit() ?
I have a String s = java; What is the output when I say s.replaceAll('j', 'k'); Also what is the value of s after replacing?
when we create singleton design then we create private constructtor..so how JVM take private constructor to make object..but it's private..
can rmi and corba based applications interact ?
How are this() and super() used with constructors in java programming?
Can we make constructors static?
what are upcasting and downcasting?
What is length in java?