Solved

explain on the indexOf error

Posted on 2007-03-23
5
272 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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 the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

705 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now