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

Java support what type of parameter passing ?

7 Answers   Wipro,


What are the restriction imposed on a static method or a static block of code?

0 Answers  


What is meant by null and void?

0 Answers  


What does string intern() method do?

0 Answers  


What is the purpose of the finally clause?

3 Answers  






Explain the meaning of java applet.

0 Answers   TCS,


what is difference between business delegate and data access object(dao)? in java?

1 Answers  


What are access specifiers in java ?

0 Answers   Akamai Technologies,


Can we overload final method in java?

0 Answers  


What is double in java?

0 Answers  


class A { class B { psvm(String args[]) { } } } if the prg saved in A.java whats the o/p?

7 Answers   HCL, TCS,


What if the main() method is declared as private? What happens when the static modifier is removed from the signature of the main() method?

0 Answers  


Categories