20 lines
288 B
Java
20 lines
288 B
Java
|
|
public class MyClass{
|
||
|
|
|
||
|
|
// instance variable
|
||
|
|
private int variable; // Note: instance variables are usually "private"
|
||
|
|
|
||
|
|
/**
|
||
|
|
* The constructor
|
||
|
|
*/
|
||
|
|
public MyClass(){
|
||
|
|
// creates a new instance
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* A method
|
||
|
|
*/
|
||
|
|
public void someMethod(){
|
||
|
|
this.variable = 1;
|
||
|
|
}
|
||
|
|
}
|