• Post Reply Bookmark Topic Watch Topic
  • New Topic

how come i can't call my search method from my main method?  RSS feed

 
hrin kuek
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

was wondering why i keep gettin a compiling error when i try to call my search method from my main method... ( see last few lines of code )





 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What error do you get?
 
hrin kuek
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cannot resolve symbol method searchcustName [java.lang.string,java.util.vector]
 
K Riaz
Ranch Hand
Posts: 375
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You must create an instance of the object before you can invoke methods on it.
 
hrin kuek
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh ok thx! managed to fix it.

but now i m havin another problem.. I need to display ALL records that have the same name. but when i put in a for loop like this, it jus keeps repeating the first record many times. how do i code such tt it returns all the records tt have the same custName?

 
K Riaz
Ranch Hand
Posts: 375
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use an iterator, which is inherited by the Vector class from AbstractList.


[ March 26, 2005: Message edited by: Kashif Riaz ]
 
Kareem Qureshi
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I think the class level variable custName in SearchBooking is conflicting with the method variable custName. Try changing the name either one of the variable.

Hope this helps.

Kareem
[ March 28, 2005: Message edited by: Kareem Qureshi ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!