MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / toString

Method toString

reflection/Person.java:28–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26 Person(String last) { this(null, last, null); }
27 Person() { this(null, null, null); }
28 @Override public String toString() {
29 if(empty)
30 return "<Empty>";
31 return (first.orElse("") +
32 " " + last.orElse("") +
33 " " + address.orElse("")).trim();
34 }
35 public static void main(String[] args) {
36 System.out.println(new Person());
37 System.out.println(new Person("Smith"));

Callers

nothing calls this directly

Calls 2

trimMethod · 0.80
orElseMethod · 0.80

Tested by

no test coverage detected