write a java program for a bank account. In which we can deposit money and we can check bank balance. Your initial balance will be 1,00,000. Now you have to give 3 integers on different lines. first number will be the amount you want to deposit. the second number & third number will be the amount you will withdraw. Now you have to print the total balance. You have to use Object Oriented concepts for this question.


import java.util.Scanner;
class BankAccount{
int balance = 100000;
void depositMoney(int amount) {
this.balance += amount;
}
void withdraw(int amount) {
this.balance -= amount;
}
}
public class Question {
public static void main(String[] args) {
Scanner s1 = new Scanner(System.in);
BankAccount b1 = new BankAccount();
int n1 = s1.nextInt();
b1.depositMoney(n1);
int n2 = s1.nextInt();
b1.withdraw(n2);
int n3 = s1.nextInt();
b1.withdraw(n3);
System.out.println(b1.balance);
}
}