get and set methods java code example
Example 1: get und set methoden java
this.getLukas();
public int getLukas() { return this.lukas }
Example 2: java get set
class Employ
{
public String name; //name of the employ
public String getName() //Get the name
{
return name;
}
public String setName(String newName) //Set the name
{
this.name = newName;
}
}
Example 3: java setter
public setValue(value) {
this.value = value;
}
Example 4: java getter
public getValue() {
return value;
}