Code:
public class HowTo {
private class returnResult {
private int value;
returnResult(int value) {
this.value = value;
}
private returnResult add(int other) {
returnResult result = new returnResult(0);
result.value = this.value + other;
return result;
}
}
private class internalResult {
private int value;
internalResult(int value) {
this.value = value;
}
private void add(int other) {
this.value += other;
}
}
}