class Account9{
private String type;
private double balance;
public Account9() {
System.out.println("DC Run");
type="Debit";
balance=100.99;
}
public Account9(String type){
System.out.println("PC1 Run");
type=type;
}
public Account9(String type, double balance){
System.out.println("PC2 Run");
this.type=type;
this.balance=balance;
}
public Account9(String type, double balance, double t){
System.out.println("PC2 Run");
this.type=type;
this.balance=balance+t;
}
public void showAccount(){
System.out.println("Account Type:" + type);
System.out.println("Account Balance:" + balance);
}
}
public class Account9Tesyt{
public static void main(String [] args){
Account9 acc1 = new Account9();
Account9 acc2 =new Account9("Debit");
Account9 acc3 = new Account9("Saving",200.99);
Account9 acc4 = new Account9("private", 200.99, 1000.00);
acc1.showAccount();
acc2.showAccount();
acc3.showAccount();
acc4.showAccount();
}
}
private String type;
private double balance;
public Account9() {
System.out.println("DC Run");
type="Debit";
balance=100.99;
}
public Account9(String type){
System.out.println("PC1 Run");
type=type;
}
public Account9(String type, double balance){
System.out.println("PC2 Run");
this.type=type;
this.balance=balance;
}
public Account9(String type, double balance, double t){
System.out.println("PC2 Run");
this.type=type;
this.balance=balance+t;
}
public void showAccount(){
System.out.println("Account Type:" + type);
System.out.println("Account Balance:" + balance);
}
}
public class Account9Tesyt{
public static void main(String [] args){
Account9 acc1 = new Account9();
Account9 acc2 =new Account9("Debit");
Account9 acc3 = new Account9("Saving",200.99);
Account9 acc4 = new Account9("private", 200.99, 1000.00);
acc1.showAccount();
acc2.showAccount();
acc3.showAccount();
acc4.showAccount();
}
}
Yorumlar
Yorum Gönder