2015-02-20 00:35:01 -05:00
|
|
|
public class MyClass{
|
2013-04-09 00:46:50 -07:00
|
|
|
|
|
|
|
|
// instance variable
|
|
|
|
|
private int variable; // Note: instance variables are usually "private"
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The constructor
|
|
|
|
|
*/
|
2015-02-20 00:35:01 -05:00
|
|
|
public MyClass(){
|
2013-04-09 00:46:50 -07:00
|
|
|
// creates a new instance
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A method
|
|
|
|
|
*/
|
2015-02-20 00:35:01 -05:00
|
|
|
public void someMethod(){
|
2013-04-09 00:46:50 -07:00
|
|
|
this.variable = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|