Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Java (https://www.askmehelpdesk.com/forumdisplay.php?f=440)
-   -   Do we have to consider access specifiers in overloading concept? (https://www.askmehelpdesk.com/showthread.php?t=586051)

  • Jul 6, 2011, 10:20 PM
    sandhyar
    do we have to consider access specifiers in overloading concept?
    public class OverloadTest {
    public void computeMethod( int x, float y, byte z) {}
    }
    Which of the following is considered as overloaded computeMethod ?
    private int computeMethod( int x, float y, byte z) {}
    private int computeMethod( float x, int y, byte z) {return y;}
    public float computeMethod( int x, float y, byte z) {return y;} //answer
    public void computeMethod( int a, float b, byte c) {} //y this has become invalid...



  • All times are GMT -7. The time now is 04:39 PM.