DALLASCAO.COM

Site of Cao Shouguang, English to Chinese translator

Learn Java: initializer

public class SavingsAccount {
	
	public static void main(String[] args) {
		AccountCaculation myAccount = new AccountCaculation(1000).deposit(2000);
		AccountCaculation yourAccount = new AccountCaculation().deposit(5000);		
		myAccount.printBalance();
		yourAccount.printBalance();
		System.out.println(AccountCaculation.totalBalance);
		System.out.println(AccountCaculation.usd2Rmb(myAccount.balance));
		
		//Objects(instances) as array members 
		AccountCaculation[] accountArray = new AccountCaculation[3];		
		for (int i=0; i

				

Leave a Comment