Hi, I am learning java and i am stuck at point where i don't know what i am doing wrong. I am trying to get a field that is being populated as True/False from the system to change to Yes/No. I know that i have to put an if/else statement but the problem is I don't know the correct approach to execute this.

This is the code:

strBuff.append("<td   class=\"LABEL\">" + MaterialType.getAttribute("defaultSupplierForMaterial").getAttDisplay() + ":</td><td   class=\"FORMELEMENT\">");

True and false is set to the "defaultSupplierForMaterial" and i want to to display yes and no.

Any help out there?


The logical choice would be to use the ternary operator here (check your language tutorial to find out what it is and how to use it).

You should also really consider cleaning up your program, it is terrible to read making it hard to understand and maintain.