Java calling method from Superclass and changing the return statement -


i'm calling method superclass called getstringrepresentation returns " ". fine. problem want change return statement in subclass symbol such s or o example.

currently code looks this:

public emptyspace(position position) {     super(position);     super.getstringrepresentation()         return "es"; //this doesn't work. } 

i understand string can override system.out, java tutorials don't explain or have example return statements. java tutorials don't explain or have example return statements.

main class

    public class sector     {     private position            position;   /**  * returns string containing " " (whitespace).  *   * @return returns string containg " "  */  public string getstringrepresentation() {      return " ";   } 

override method in emptyspace class:

public emptyspace(position position) {      super(position);  }  @override public string getstringrepresentation() {     return "es"; } 

Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -