class Account
{
// instance variables
private int accNo;
private String accType;
private int balance;
public int getAccno()
{
return this.accNo;
}
public String getaccType()
{
return this.accType;
}
public int getBalance()
{
return this.balance;
}
public void setBalance(int balance)
{
this.balance=balance;
}
public Account(int accNo,String accType,int balance)
{
this.accNo=accNo;
this.accType=accType;
this.balance=balance;
}
public Account()
{
}
}
public class Demo {
public static void main(String[] args)
{
Account accobj=new Account(12562001,"Savings",2000);
System.out.println(accobj.getAccno()+" "+accobj.getaccType()+"
"+accobj.getBalance());
accobj.setBalance(31000);
System.out.println("After updation .......................");
System.out.println(accobj.getAccno()+" "+accobj.getaccType()+"
"+accobj.getBalance());
}
}