#output not coming same when clicked on void display the second time

1 messages ยท Page 1 of 1 (latest)

dense wedgeBOT
#

<@&987246399047479336> please have a look, thanks.

dense wedgeBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.

Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.

smoky cosmos
#

please share the full code, not just this class

#

and also not as image please

ancient scarab
#

public class BankCard
{
//attributes of class BankCard
private int cardId;
private int balanceAmount;
private String bankAccount;
private String clientName;
private String issuerBank;

//Making a consturctor which accepts four parameters that are bankAccount, balanceAmount, issuerBank and carId 
public BankCard(int cardId, String bankAccount,  int balanceAmount, String issuerBank){
    this.cardId = cardId;
    this.bankAccount = bankAccount;
    this.balanceAmount= balanceAmount;
    this.clientName= "";
    this.issuerBank=issuerBank;
}
   
   
//accessor or getter method
public int getcardId(){
    return this.cardId;
}

public String getbankAccount(){
    return this.bankAccount;
}

public int getbalanceAmount(){
    return this.balanceAmount;
}

public String getclientName(){
    return this.clientName;
}

public String getissuerBank(){
    return this.issuerBank;
}
#

//setter/mutator method for client name and balance amount
public void setclientName(String clientName){
this.clientName= clientName;
}
public void setbalanceAmount(int balanceAmount){
this.balanceAmount = balanceAmount;
}

//display method
public void display(){
    if (this.clientName.equals("")){
   
       System.out.println("Error Client Name is Not Assigned");
       
    } 
    else{
   
       System.out.println("Client Name: "+ clientName);
       System.out.println("Card Id: "+cardId);
       System.out.println("Bank Account: "+ bankAccount);
       System.out.println("Balance Amount: "+ balanceAmount);
       System.out.println("Issued Bank: "+ issuerBank);
   
   }
}

}

smoky cosmos
#

full code and with discord formatting please. or just upload the files

ancient scarab
#

i will upload the files

dense wedgeBOT
# ancient scarab

I uploaded your attachments as gist. That way, they are easier to read for everyone, especially mobile users ๐Ÿ‘

ancient scarab
#

@smoky cosmos

#

in my credit card class i just want to display issufficent balance when the credit limit is more than my balance amount it is showing me the correct display at first but it shows me deatils like clientName id etc at second