package amol;
class Amoo {
int acc_no;
String Name;
double bal;
static double interstrate;
static{
interstrate=10.3;
}
public int getAcc_no() {
return acc_no;
}
public void setAcc_no(int acc_no) {
this.acc_no = acc_no;
}
public String getName() {
return Name;
}
public void setName(String name) {
Name = name;
}
public double getBal() {
return bal;
}
public void setBal(double bal) {
this.bal = bal;
}
public static double getInterstrate() {
return interstrate;
}
public static void setInterstrate(double interstrate) {
Amoo.interstrate = interstrate;
} // END HERE SETTER AND GETTR
public Amoo() {
acc_no = 100;
Name = "Amol";
bal = 500;
}
public Amoo(int acc_no, String name, double bal) {
this.acc_no = acc_no;
Name = name;
this.bal = bal;
} // PARAMETR CONSUTOR
void display()
{
System.out.println("Account Number is ="+acc_no+"\nNAme is ="+Name+"\nBalance is a = "+bal+"\ninterstrate "+interstrate);
}
public static void main(String[] args) {
Amoo a=new Amoo(101,"Akshay",5000);
a.display();
System.out.println();
Amoo a1=new Amoo(102,"Amol",50000);
a1.display();
System.out.println();
Amoo a2=new Amoo(103,"Tejas",50000);
a2.display();
}
}
class Amoo {
int acc_no;
String Name;
double bal;
static double interstrate;
static{
interstrate=10.3;
}
public int getAcc_no() {
return acc_no;
}
public void setAcc_no(int acc_no) {
this.acc_no = acc_no;
}
public String getName() {
return Name;
}
public void setName(String name) {
Name = name;
}
public double getBal() {
return bal;
}
public void setBal(double bal) {
this.bal = bal;
}
public static double getInterstrate() {
return interstrate;
}
public static void setInterstrate(double interstrate) {
Amoo.interstrate = interstrate;
} // END HERE SETTER AND GETTR
public Amoo() {
acc_no = 100;
Name = "Amol";
bal = 500;
}
public Amoo(int acc_no, String name, double bal) {
this.acc_no = acc_no;
Name = name;
this.bal = bal;
} // PARAMETR CONSUTOR
void display()
{
System.out.println("Account Number is ="+acc_no+"\nNAme is ="+Name+"\nBalance is a = "+bal+"\ninterstrate "+interstrate);
}
public static void main(String[] args) {
Amoo a=new Amoo(101,"Akshay",5000);
a.display();
System.out.println();
Amoo a1=new Amoo(102,"Amol",50000);
a1.display();
System.out.println();
Amoo a2=new Amoo(103,"Tejas",50000);
a2.display();
}
}
No comments:
Post a Comment