0% found this document useful (0 votes)
3 views2 pages

Bankaccount Void String Int String Float: Public Class Public Static

Uploaded by

24csu205
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Bankaccount Void String Int String Float: Public Class Public Static

Uploaded by

24csu205
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

//Design a class BankAccount with the following:

//Instance variables: accountNumber, accountHolder, balance.


//A constructor to initialize account details.
//Methods:
//deposit(double amount) → increases balance
//withdraw(double amount) → decreases balance if sufficient funds
//display() → prints account details
//In main, create 2 accounts, perform deposit & withdrawal operations, and
display updated details.
public class BankAccount {
public static void main(String[] args){
int accountNumber;
String accountHolder;
float balance;
BankAccount() {
accountHolder="Java";
accountNumber=12333637;
balance=900;
}
double res;
public void withdraw(double amount) {

}
}

//Design a class BankAccount with the following:


//Instance variables: accountNumber, accountHolder, balance.
//A constructor to initialize account details.
//Methods:
//deposit(double amount) → increases balance
//withdraw(double amount) → decreases balance if sufficient funds
//display() → prints account details
//In main, create 2 accounts, perform deposit & withdrawal operations, and
display updated details.
public class BankAccount {
public static void main(String[] args){
int accountNumber;
String accountHolder;
float balance;
BankAccount() {
accountHolder="Java";
accountNumber=12333637;
balance=900;
}
double res;
public void withdraw(double amount) {

}
}

You might also like