I have a class:
public class C1{
public int v=10;
public int myFunction1(){
// some code
}
}
To call myFunction1()
we use:
C1 ob = new C1();
ob.myFunction1();
ob.v;
Same thing with `static':
public class C1{
public static int v=10;
public static int myFunction1(){
// some code
}
}
To call myFunction1()
we use:
C1.myFunction1();
C1.v;
SO my question is what is the difference between these two approach. When its good to use static
approach? What are the technical advantage and disadvantage of both?