I'm doing a computer science project and I need to incorporate StringBuffer
s. I need help with what .append
does and what concatenate means. Somebody told me I can show who is the winner (of my game) by using .append
with StringBuffer
.
public static void winner ()
{
if (position1 >= 100){
System.out.println("THE WINNER IS " + name1);
}
else if (position2 >= 100){
System.out.println("THE WINNER IS " + name2);
}
}
Instead of having name as strings, can I use StringBuffer
to output who won the game?