ACCESSING FUNCTION OF ONE CLASS FROM OTHER CLASS IN JAVA

 public class A {

    int x=22;

    public static void show(int xy)

    {

    System.out.println("show with one parameter  :"+xy);

    }

    public void show()

    {

    System.out.println("show with zero parameter ");

    }

}

class Programmer
{
public static void main(String ar[])
{
A obj=new A();
obj.show();
A.show(5);
System.out.println(obj.x);
}
}

Comments

Popular posts from this blog

CREATING OBJECT USING REFLECTION