Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

explain on the indexOf error

Posted on 2007-03-23
5
Medium Priority
?
285 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
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…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

636 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