Study
2008. 5. 31. 15:35
은행 업무 (계좌 생성, 입금, 출금, 송금)
class Banking { static int count; int account; String name; double money; public Banking(int account, String name, double money){ this.account = account; this.name = name; this.money = money; System.out.println(account + " " + name + " " + money); count++; } public void deposit(double money){ this.money += money; System.out.println(account + " " + name + " " + this.money); } public void withdraw(double money){ this.money -= money; System.out.println(account + " " + name + " " + this.money); } } class Result { public static void sendmoney(Banking acc1, Banking acc2, double money){ acc1.withdraw(money); acc2.deposit(money); } public static void main(String args[]){ Banking acc1 = new Banking(103528173, "왕건", 10000); Banking acc2 = new Banking(208272343, "궁예", 20000); acc1.deposit(100000); acc1.withdraw(50000); acc2.deposit(200000); sendmoney(acc2, acc1, 70000); acc1.deposit(30000); acc2.withdraw(60000); System.out.println("생성된 계좌의 갯수 : "+Banking.count+"개"); } }
공유하기
게시글 관리
솔직한 목소리
blog
profile
tag cloud
travel log
guest book
by
bslime
전체보기
(52)
목소리
(1)
영화
(0)
음악
(0)
Study
(34)
Security
(12)
Web
(2)
WLAN
(7)
Network
(1)
System
(1)
Wargame
(5)
Web
(0)
Reverse Engineering
(3)
Crypto
(2)
폐인
padocon
티스토리
미로
Maze
삽질
초대장
Algorithm
잘했어요
CTF
«
2025/01
»
일
월
화
수
목
금
토
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
darktoil.
인생여전龍군.
슝이.
MR-J@.
미움.
vvipbeom.
Copyright ⓒ 2010.
bslime
, Skin designed by
Creasmworks.
All rights reserved.
티스토리툴바