Question: IN JAVA. Is there a way to have the true or false display Yes or No in my output without changing the method type of

IN JAVA. Is there a way to have the true or false display "Yes" or "No" in my output without changing the method type of my boolean method? Here I have my boolean method, display method, and output.

public boolean isGamePlayed() { return gamePlayed; }

--------------------------------------------------------------

@Override public void displayItem() { System.out.println("** Video Game Information **"); System.out.println("Title: " + getGameTitle()); System.out.println("System: " + getGameSystem()); System.out.println("Times Finished: " + getTimesFinished()); System.out.println("Game Played: " + isGamePlayed()); System.out.println(); }

-----------------------------------------------------------------------------------------

IN JAVA. Is there a way to have the true or false

Is there a way to have the above output replace the false with "No" or true with "Yes" without changing the boolean method? The method is required to be boolean but the outside has to say yes or no instead of true or false.

** Game Test 1 ** Video Game Information Title: System: Times Finished: 0 Game Played: false

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!