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

INTERVIEW QUESTION FOR ANDROID

0 Answers  


explain autoboxing in java?

0 Answers  


Which collection is thread safe in java?

0 Answers  


How do you classify Dialog Box?

0 Answers   CGI,


make a method which any number and any type of argument and print sum of that arguments.....

0 Answers  






Hi, well i am unable to understand that why it is mandatory to have same hashcode, if two objects are same? Thanks in advance.

5 Answers  


What is the largest long allowed by java?

0 Answers  


Explain class A{} class B{} class C{} all the three classes are saved in a single file name, what the name should i provide to the file ,in what file name should i run the program? Ple Explain

9 Answers   DNS, Infosys, TCS,


What is :: operator in java?

0 Answers  


What is the difference between stringbuffer and stringbuilder?

0 Answers  


What is a methodologist?

0 Answers  


What does the @override annotation do?

0 Answers  


Categories