?
Solved

explain on the indexOf error

Posted on 2007-03-23
5
Medium Priority
?
283 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 375 total points
ID: 18784155
> how can i declare that method in taxis?


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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses
Course of the Month14 days, 22 hours left to enroll

770 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