You are correct Shankar.  The problem here is that the overloaded fill()
method does not alter the state of the class.  String fillMe and Integer
fillMe are both local to the methods, they are not instance variables.
Alter your Class such that those methods will set and instance variable.
e.g

class test
{
    /**
     *  Description of the Method
     *
     *@param  fillMe  Description of the Parameter
     */
    public void fill(String fillMe)
    {
        sfillMe = "test";
    }


    /**
     *  Description of the Method
     *
     *@param  fillMe  Description of the Parameter
     */
    public void fill(Integer fillMe)
    {
        ifillMe = new Integer(100);
    }


    /**
     *  Description of the Method
     *
     *@param  args  Description of the Parameter
     */
    public static void main(String args[])
    {

        try
        {
            test objTest = new test();
            String testfill = new String("main");
            objTest.fill(testfill);
            System.out.println("Fill me result:" + testfill);

            Integer intFill = new Integer(200);
            objTest.fill(intFill);
            System.out.println("Fill me result:" + intFill);

        } catch (Exception e)
        {
            e.printStackTrace();
        }
    }
        private String sfillme = null;
        private Integer ifillme = null;
}


To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm

Reply via email to