Long l = 0l;
this.l = l;
this.l = 150l;
class Test {
public static void main(String[] args) {
LongHolder holder = new LongHolder(0L);
System.out.println(holder);
updateValue(holder, 150L);
System.out.println(holder);
}
private static void updateValue(LongHolder holder, Long newValue) {
holder.setValue(newValue);
}
private static class LongHolder{
private Long value;
public LongHolder(Long value) {
this.value = value;
}
public Long getValue() {
return value;
}
public void setValue(Long value) {
this.value = value;
}
@Override
public String toString() {
return "LongHolder{" +
"value=" + value +
'}';
}
}
}