Results 1 to 2 of 2
  1. #1
    darkblue24 is offline Member
    Join Date
    Jan 2010
    Posts
    36
    Rep Power
    0

    Post Semantic error: Message incrementMedalCount() not understood by class'OlympicFrog'

    Hi All

    I have error: Semantic error: Message incrementMedalCount() not understood by class'OlympicFrog'

    Below is my code. What is wrong with incrementMedalCount() method??

    Java Code:
    /**
     * Class OlympicFrog - Extends Frog Class with one additional instance variable: medalCount
     * (it holds the number of medals won by instance of OlympicFrog)
     * 
     * @author Marcin Steciuk
     * @version 1.0
     */
    public class OlympicFrog extends Frog
    {
    	/* instance variables */
    	private int medalCount; 
    	private static OlympicFrog currentLeader = null; //OlympicFrog that has the most medals
    
    
    	/**
    	 * Constructor for objects of class OlympicFrog 
    	 */
    	public OlympicFrog()
    	{
    		super();
    		this.medalCount = 0;
    	}
    
    
    	/* instance methods */
    
    	/**
    	 * Getter method for medalCount (returns value of medalCount)
    	 */
    	public int getMedalCount()
    	{
    		return this.medalCount;	
    	}
    	
    	/**
    	 * Getter method for currentLeader (returns value of currentLeader)
    	 */
    	public OlympicFrog getCurrentLeader()
    	{
    		return OlympicFrog.currentLeader;	
    	}
    	
    	/**
    	 * Setter method for currentLeader 
    	 */
    	public void setCurrentLeader(OlympicFrog aValue)
    	{
    		OlympicFrog.currentLeader = aValue;	
    	}
    	   
    	
       /**
        * Increments the position of the medalCount by 1.
        */
       private void incrementMedalCount()
       {
          this.medalCount = this.medalCount + 1;
       }
    }

  2. #2
    darkblue24 is offline Member
    Join Date
    Jan 2010
    Posts
    36
    Rep Power
    0

    Default

    Guys I found the issue = its cause its declared as private.

Similar Threads

  1. Help with a error message desparate
    By Chewart in forum New To Java
    Replies: 34
    Last Post: 01-23-2010, 06:59 PM
  2. Error Message????
    By Cubba27 in forum New To Java
    Replies: 11
    Last Post: 11-21-2009, 03:46 PM
  3. Replies: 8
    Last Post: 07-22-2009, 02:16 AM
  4. Error Message in JBuilder
    By RavenNevarmore in forum New To Java
    Replies: 4
    Last Post: 10-08-2008, 07:53 AM
  5. error message on jsp
    By sandor in forum Web Frameworks
    Replies: 1
    Last Post: 04-11-2007, 03:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •