code to explanationWed, 28 Dec 2022

public String toString() { return ("DVD: " + this.getTitleName()); } }

The toString method takes no arguments and returns a String.

Questions about programming?Chat with your personal AI assistant