-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAccountTest1.java
More file actions
42 lines (27 loc) · 796 Bytes
/
AccountTest1.java
File metadata and controls
42 lines (27 loc) · 796 Bytes
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
32
33
34
35
36
37
38
39
40
41
42
class Account {
public String type;
public double balance;
public void setAccount(String typ, double blc){
type=typ; balance=blc;
}
public String getType(){
return type;
}
public double getBalance(){
return balance;
}
}
public class AccountTest1{
public static void main (String [] args){
System.out.println("Account Test");
Account acc0=new Account();
Account acc1=new Account();
acc0.type="Debit";
acc0.balance=0.0;
System.out.println( "acc0 type : "+acc0.type);
System.out.println( "acc0 balance : "+acc0.balance );
acc1.setAccount("Saving", 10.0);
System.out.println( "acc1 type : "+acc1.type );
System.out.println( "acc1 balance : "+acc1.balance );
}
}