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

Explain the difference between map and flatmap stream operation?

0 Answers  


Can you override static methods?

0 Answers  


What is numeric function?

0 Answers  


What is use of functional interface in java 8? Explain

0 Answers  


How are multiple inheritances done in Java?

0 Answers   Atos Origin,






what is the use of StringBuffer?

2 Answers   Accenture,


i need example for java abstraction. where we use abstraction and why we need abstraction.

2 Answers   Oracle,


how cani read a command line argument?(usingfile object).

3 Answers  


Can a final variable be null?

0 Answers  


Why is boolean important?

0 Answers  


How do you read a char in java?

0 Answers  


What is difference between local variable and global variable?

0 Answers  


Categories