• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

please clarify my doubts in Vectors?

 
Raja seemakurthi
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


i got this question from the following URL.
http://www.valoxo.ch/jr/mocks/mock01a.html

we can use add() for adding objects like Integer,Float class into Vector. According to my knowledge the output should be [1,2,0,2].
Am i wrong? please guide me.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49382
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please tell us where the question is from We don't simply hand out that sort of answer; please explain how you think the question works, by going through the exercise line by line.
 
Tekchand Prasad
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Campbell Ritchie
Sheriff
Pie
Posts: 49382
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tekchand Prasad, thank you for replying, but please don't simply give the explanation. It does the original poster no good; it is much better if they work it out for themselves. Please have a look at this FAQ, as well as the heading of the beginner's forum page. Please don't be annoyed with me, but I have deleted the code copied with the little explanations.
 
Albareto McKenzie
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Raja,

Why do you expect that? Have you tried that code?
You are right, the add method allow you to add Objects to the Vector, anyway, take a look at the Vector javadoc, it will help you a lot!!

http://java.sun.com/j2se/1.5.0/docs/api/
 
Raja seemakurthi
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
let me say sorry for asking this kind of question.
i have gone through the API and read the related functions used in the code.
i ran the file and understood the output.

Anyways thanks for your comments and help also.
wish me all the best for certification exam.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49382
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well done working it out. No need to say sorry; you were quite right to ask that sort of question. But we should still see where the question was from.
 
Raja seemakurthi
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I got this question from the following URL.
http://www.valoxo.ch/jr/mocks/mock01a.html

Already i put this link in my first request itself.
 
Brian Legg
Ranch Hand
Posts: 488
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should post your answer/findings for others to stumble on. Thanks and glad you found the answer.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic