I need help adding and understanding an instance variable and method
I need help adding and understanding an instance variable and method
to this program. I have been doing research and readings but still do not understand how a variable and method can be linked to an object.
public class number
{
static int a=1;
static void number()
{
System.out.println(“value of a is “+a);
}
public static void main(String[] args)
{
System.out.println(“inside static method”);
number.number();
}
}