Solved

explain on the indexOf error

Posted on 2007-03-23
5
276 Views
Last Modified: 2013-11-23
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
Comment
Question by:teena3070
  • 2
  • 2
5 Comments
 
LVL 23

Expert Comment

by:Ajay-Singh
ID: 18782597
class TaxiS doesn't have indexOf method
0
 
LVL 20

Expert Comment

by:gatorvip
ID: 18782965
the data[] array (of whatever kind it is) doesn't have an indexOf method....
0
 

Author Comment

by:teena3070
ID: 18783244
how can i declare that method in taxis?

0
 
LVL 20

Expert Comment

by:gatorvip
ID: 18783849
can you post the relevant code? We don't know what you have.
0
 
LVL 23

Accepted Solution

by:
Ajay-Singh earned 125 total points
ID: 18784155
> how can i declare that method in taxis?


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

Featured Post

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
thymeleaf natural templating vs JSP 2 104
what is a "java.lang.System Property"   ? 20 67
maven project error 5 56
couple of eclipse 5 38
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This video teaches viewers about errors in exception handling.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question