
account a=new account(100);
value 100 is used for what purpose of the object?

Hello Friend,
We are providing you an example that will illustrate you.
class account {
String name = "";
int balance = 0;
account(String n,int bal){
name=n;
balance=bal;
}
void display(){
System.out.println("Name:"+name+"\nBalance:"+balance);
}
public static void main(String[]args){
account a=new account("rose",10000);
a.display();
}
}
Thanks

Hello Friend,
We are providing you an example that will illustrate you.
class account {
String name = "";
int balance = 0;
account(String n,int bal){
name=n;
balance=bal;
}
void display(){
System.out.println("Name:"+name+"\nBalance:"+balance);
}
public static void main(String[]args){
account a=new account("rose",10000);
a.display();
}
}
Thanks

Thank you so much for clearing my doubt. :D
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.