Thread: Errors when compiling

Results 1 to 6 of 6
  1. #1 Errors when compiling 
    Registered Member
    Join Date
    Sep 2013
    Posts
    19
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Attached image
    Reply With Quote  
     

  2. #2  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    Quote Originally Posted by Dunkerpker View Post
    Attached image
    The "eat" and "isFood" method don't exist in Food.java. You need to create them.
    Project thread
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Sep 2013
    Posts
    19
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by clem585 View Post
    The "eat" and "isFood" method don't exist in Food.java. You need to create them.
    How exactly would i make the method for it? Sorry I'm a little new to all this.
    Reply With Quote  
     

  4. #4  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    Quote Originally Posted by Dunkerpker View Post
    How exactly would i make the method for it? Sorry I'm a little new to all this.
    Code:
    public boolean isFood(int itemId) {[
    //CODE
    }

    Code:
    public void eat(int itemId, int itemSlot) {
    //CODE
    }
    Looking at how the player variable is named "c" I think this is a 317. You might get more help posting here: Help
    Project thread
    Reply With Quote  
     

  5. #5  
    Banned

    Join Date
    Jan 2012
    Age
    25
    Posts
    2,703
    Thanks given
    906
    Thanks received
    630
    Rep Power
    0
    Quote Originally Posted by Dunkerpker View Post
    How exactly would i make the method for it? Sorry I'm a little new to all this.
    At the top of the class you will see imports, you need to import Food.java The error is basically telling you it can't use methods from a class which isn't local or hasn't been imported.

    Reply With Quote  
     

  6. #6  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    Quote Originally Posted by Sam' View Post
    At the top of the class you will see imports, you need to import Food.java The error is basically telling you it can't use methods from a class which isn't local or hasn't been imported.

    Oh derp. I haven't used compiler in a while. Too used to IDE that do everything for you.
    Project thread
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 10
    Last Post: 01-04-2010, 10:53 AM
  2. Error When Compiling
    By 2good4you in forum Help
    Replies: 10
    Last Post: 01-01-2010, 01:57 AM
  3. 2 small errors when compiling
    By DarkArt in forum Help
    Replies: 6
    Last Post: 12-27-2009, 12:53 AM
  4. tempSave ERROR WHEN COMPILING
    By Ryann in forum Help
    Replies: 2
    Last Post: 10-29-2009, 03:50 AM
  5. Javac error when Compiling? - Fix it!
    By Mickle in forum Tutorials
    Replies: 2
    Last Post: 12-04-2007, 05:13 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •