public static void main(String[] args)
{
int length=getLength();
System.out.println("Your length is: "+length);
}
//methods are outside of main method
public static int getLength()
{
int length=5;
return length;
}
public class MyClass {
private int value = 10;
// getter method
public int getValue() {
return value;
}
// setter method
public void setValue(int value) {
this.value = value;
}
}