Name: B.
Latha Sagar
RegNo: 12204652
Roll No: 42
Section: D2212
Course Code: CAP680
Assignment-8
source code:
package assignment;
import [Link].*;
public class Bank
synchronized void deposit()
[Link]("Enter the amount to deposit :");
Scanner sc=new Scanner([Link]);
int deposit=[Link]();
[Link]("Amount Successfully Deposited "+deposit);
[Link]("Enter amount for withdraw :");
int withdraw=[Link]();
[Link]("Amount Successfully withdrawn "+withdraw);
int totalBalance=deposit-withdraw;
[Link]("Total current balance : "+totalBalance);
try {
[Link]( 1000);
catch(Exception e)
public static void main(String[]args)
Bank s=new Bank();
Customer1 f=new Customer1(s);
Customer2 a=new Customer2(s);
[Link]();
[Link]();
class Customer1 extends Thread
Bank s1;
Customer1( Bank s1)
this.s1=s1;
public void run()
[Link]();
class Customer2 extends Thread
{
Bank s2;
Customer2( Bank s2)
this.s2=s2;
public void run()
[Link]();
Output: