Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- /**
- *
- * @author sudonym
- */
- public class Tabungan {
- int saldo;
- public Tabungan(int initsaldo){
- this.saldo = initsaldo;
- }
- public int getSaldo(){
- return saldo;
- }
- public void simpanUang(int jumlah){
- this.saldo = saldo + jumlah;
- }
- public boolean ambilUang(int jumlah){
- if(jumlah > this.saldo){
- return false;
- }else{
- this.saldo -= jumlah;
- return true;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement