• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

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

 
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 )





 
author
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]
 
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 ]
 
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 ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!