• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 287
  • Last Modified:

explain on the indexOf error

c:\Object Oriented JAVA\taxiprog\taxisuccess\TaxiInv.java:66: cannot find symbol
symbol  : method indexOf(java.lang.String)
location: class TaxiS
        if (data[index].indexOf(sW) != -1)
                ^
Note: C:\Users\blobo\Desktop\Assignment 1st Semester\Object Oriented JAVA\taxiprog\taxisuccess\TaxiInv.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error

Tool completed with exit code 1

Can someone explain to me on this error? it's actually point to the square bracket [?

need urgent help!!
0
teena3070
Asked:
teena3070
  • 2
  • 2
1 Solution
 
Ajay-SinghCommented:
class TaxiS doesn't have indexOf method
0
 
gatorvipCommented:
the data[] array (of whatever kind it is) doesn't have an indexOf method....
0
 
teena3070Author Commented:
how can i declare that method in taxis?

0
 
gatorvipCommented:
can you post the relevant code? We don't know what you have.
0
 
Ajay-SinghCommented:
> how can i declare that method in taxis?


public int indexOf(String text) {
  // Method body goes here.
}
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now