Haiku.java by ubiquitoid

T-Shirts & Hoodies

Clothing Style:
or
$25.52
Available to buy on…


For literate geeks: An original haiku in (valid) Java.

© Marc Weber. All rights reserved.

Notes on implementation:

  • The top-level HaikuBuilder class is not public, so it can be saved in a file by a different name (e.g., Haiku.java).
  • A Haiku class needs to be defined.
  • A Hai class needs to be defined as a subclass of Haiku (so that a Hai reference can be upcast to type Haiku), and Hai must have a constructor that takes a String argument.
  • Once an instance of HaikuBuilder is created, its compose method can be called to return a reference to a new instance of Haiku.

Related: main method

desktop tablet-landscape content-width tablet-portrait workstream-4-across phone-landscape phone-portrait

10%off for joining

the Redbubble mailing list

Receive exclusive deals and awesome artist news and content right to your inbox. Free for your convenience.