write a program to create an vector and listeterator.and value
should be enter through keyboard.



write a program to create an vector and listeterator.and value should be enter through keyboard...

Answer / magreal

public static void main(String[] args) {

String str;
Vector<String> v = new Vector<String>();
do{
str = TextIO.getln();
v.add(str);
TextIO.putln("Add the item ? Y/N");
}while(TextIO.getlnBoolean());

for(String s: v){
TextIO.putln(s);
}
}

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More Core Java Interview Questions

Can static methods access instance variables in java?

0 Answers  


What are the six ways to use this keyword?

0 Answers  


what is the difference b/w static and final methods?

1 Answers  


What is difference between core java and java ee?

0 Answers  


What is main string [] args?

0 Answers  


Is set sorted in java?

0 Answers  


What is difference between Eclips and MyEclips?

3 Answers  


How do I convert a numeric ip address like 192.18.97.39 into a hostname like java.sun.com?

0 Answers  


Why transient variables wont participate in serialization?

2 Answers  


what is custom tags with example?

3 Answers   Amdocs,


How can we access some class in another class in java?

0 Answers  


What do you understand by copy constructor in java?

0 Answers  


Categories