Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Insert method....

 
billy ghot
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is my method...

ok, in the main application, when i do...


the compiler says it cannot find Insert.

please help..
thanks justin billy ghot
 
jiju ka
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java is case sensitive.

You need to call insert not Insert.

Your class name is Insert while method name is insert.

If you are calling insert from main method (or any method) of Insert class(or subclass), you can just say insert(A, 25)

If you are calling from any other class you need to specify Insert.insert(A, 25)
 
billy ghot
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i do put insert, not Insert, that was my bad....and it still says it cannont find symbol insert...
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where is your main method? If it's in the same class it ought to compile. If not, you'll need to put the classname Insert.insert(...)

When I put main() in the same class, I got an index out of bounds a little later. I'll let you figure that one out.

Here's the main I added:

[ November 22, 2005: Message edited by: Stan James ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic