Kotlinlearncs.online LogoJava
Return to List

Solve: String Both Ways Anonymous Class

Created By: Geoffrey Challen
/ Version: 2021.10.0

Declare a public class BothWays providing one static method create. create takes a single String parameter and returns an anonymous object that implements the IBothWays interface:

So, for example:

If the String passed to create is null, throw an IllegalArgumentException.

Related Lessons

Stuck? You may find these lessons helpful:


Attribution must link to this page: https://www.learncs.online/solve/java/string-both-ways-anonymous-class/[email protected]