bank class
public class Account {
private int number;
private double balance;
private String customername;
private String customerEmailAdress;
private String customerPhoneNumber;
// public Account(){
// //default Constructor
// this(1,0.0d,"default","default","default");
// System.out.println("Defaut constructor created");
// }
public Account(int number,double balance,String customername,String customerEmailAdress,String customerPhoneNumber){
System.out.println("New Account has been created");
this.number = number ;
this.balance = balance ;
this.customername = customername;
this.customerEmailAdress =customerEmailAdress;
this.customerPhoneNumber = customerPhoneNumber ;
}
public Account(){
//default Constructor generated first
this(1,0.0d,"default","default","default");
System.out.println("Defaut constructor created");
}
public void depoist(double depositeAmount){
this.balance += depositeAmount;
System.out.print("Deposit of "+depositeAmount+" made. New balance is "+balance);
}
public void withdraw(double withdrowAmount){
if(this.balance - withdrowAmount < 0){
System.out.print("only "+balance+" available. withdraw not processed");
}
this.balance-=withdrowAmount;
System.out.print("withdrawal of "+withdrowAmount+"processed. your balance now is"+this.balance);
}
public int getNumber() {
return number;
}
public void setNumber(int number) {
this.number = number;
}
public double getBalance() {
return balance;
}
public void setBalance(int balance) {
this.balance = balance;
}
public String getCustomername() {
return customername;
}
public void setCustomername(String customername) {
this.customername = customername;
}
public String getCustomerEmailAdress() {
return customerEmailAdress;
}
public void setCustomerEmailAdress(String customerEmailAdress) {
this.customerEmailAdress = customerEmailAdress;
}
public String getCustomerPhoneNumber() {
return customerPhoneNumber;
}
public void setCustomerPhoneNumber(String customerPhoneNumber) {
this.customerPhoneNumber = customerPhoneNumber;
}
public void setbalance(double balance) {
this.balance = balance;
}
}
4.83
5
public class Account {
private int number;
private double balance;
private String customername;
private String customerEmailAdress;
private String customerPhoneNumber;
// public Account(){
// //default Constructor
// this(1,0.0d,"default","default","default");
// System.out.println("Defaut constructor created");
// }
public Account(int number,double balance,String customername,String customerEmailAdress,String customerPhoneNumber){
System.out.println("New Account has been created");
this.number = number ;
this.balance = balance ;
this.customername = customername;
this.customerEmailAdress =customerEmailAdress;
this.customerPhoneNumber = customerPhoneNumber ;
}
public Account(){
//default Constructor generated first
this(1,0.0d,"default","default","default");
System.out.println("Defaut constructor created");
}
public void depoist(double depositeAmount){
this.balance += depositeAmount;
System.out.print("Deposit of "+depositeAmount+" made. New balance is "+balance);
}
public void withdraw(double withdrowAmount){
if(this.balance - withdrowAmount < 0){
System.out.print("only "+balance+" available. withdraw not processed");
}
this.balance-=withdrowAmount;
System.out.print("withdrawal of "+withdrowAmount+"processed. your balance now is"+this.balance);
}
public int getNumber() {
return number;
}
public void setNumber(int number) {
this.number = number;
}
public double getBalance() {
return balance;
}
public void setBalance(int balance) {
this.balance = balance;
}
public String getCustomername() {
return customername;
}
public void setCustomername(String customername) {
this.customername = customername;
}
public String getCustomerEmailAdress() {
return customerEmailAdress;
}
public void setCustomerEmailAdress(String customerEmailAdress) {
this.customerEmailAdress = customerEmailAdress;
}
public String getCustomerPhoneNumber() {
return customerPhoneNumber;
}
public void setCustomerPhoneNumber(String customerPhoneNumber) {
this.customerPhoneNumber = customerPhoneNumber;
}
public void setbalance(double balance) {
this.balance = balance;
}
}
Thank you!
5
0
3.7
9
public class Account {
private int number;
private double balance;
private String customername;
private String customerEmailAdress;
private String customerPhoneNumber;
// public Account(){
// //default Constructor
// this(1,0.0d,"default","default","default");
// System.out.println("Defaut constructor created");
// }
public Account(int number,double balance,String customername,String customerEmailAdress,String customerPhoneNumber){
System.out.println("New Account has been created");
this.number = number ;
this.balance = balance ;
this.customername = customername;
this.customerEmailAdress =customerEmailAdress;
this.customerPhoneNumber = customerPhoneNumber ;
}
public Account(){
//default Constructor generated first
this(1,0.0d,"default","default","default");
System.out.println("Defaut constructor created");
}
public void depoist(double depositeAmount){
this.balance += depositeAmount;
System.out.print("Deposit of "+depositeAmount+" made. New balance is "+balance);
}
public void withdraw(double withdrowAmount){
if(this.balance - withdrowAmount < 0){
System.out.print("only "+balance+" available. withdraw not processed");
}
this.balance-=withdrowAmount;
System.out.print("withdrawal of "+withdrowAmount+"processed. your balance now is"+this.balance);
}
public int getNumber() {
return number;
}
public void setNumber(int number) {
this.number = number;
}
public double getBalance() {
return balance;
}
public void setBalance(int balance) {
this.balance = balance;
}
public String getCustomername() {
return customername;
}
public void setCustomername(String customername) {
this.customername = customername;
}
public String getCustomerEmailAdress() {
return customerEmailAdress;
}
public void setCustomerEmailAdress(String customerEmailAdress) {
this.customerEmailAdress = customerEmailAdress;
}
public String getCustomerPhoneNumber() {
return customerPhoneNumber;
}
public void setCustomerPhoneNumber(String customerPhoneNumber) {
this.customerPhoneNumber = customerPhoneNumber;
}
public void setbalance(double balance) {
this.balance = balance;
}
}
Thank you!
9
0
Are there any code examples left?
New code examples in category Java
-
Java 2022-03-27 21:35:04 Sort string array in case insensitive order and case sensitive order java
-
Java 2022-03-27 21:25:10 java -jar -l resources\es.porperties -i ejemplo.txt -o inject.bin
-
Java 2022-03-27 21:20:21 Debug & Fix a 2-Dimensional Array Java Console Application
-
Java 2022-03-27 20:40:19 TreeSet headSet(E toElement) method in java
-
Java 2022-03-27 19:30:06 close keyboard android
-
Java 2022-03-27 19:20:40 java measure execution time
-
Java 2022-03-27 19:10:06 how to add cardview support in android studio
-
Java 2022-03-27 18:55:08 android studio lower case letters on a button