In more practical terms, if the method do () is not static (and therefore must use the variables you initialize with the manufacturer, etc..) Is used as follows:
Code:
BohClass bc = new (...); BohClass
bc.do ();
If it is a static method (and hence should not use class variables) is used as follows:
A static method do:
Code:
public class BohClass (
pubic static int do (int n) (
int x = 3;
return x + n;
)
)
static method do not:
Code:
public class BohClass (
int y = 5;
public int do (int n) (
int x = 3;
return y + x + n;
)
)
Bookmarks