-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[W6.4h][W15-B1]Yang Yuqing #753
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good PR. Minor comments have been made. Please check them out and close this PR. Overall, the PR has been sent a bit late, please take care of this in future tutorials.
/** | ||
* Returns a String representation of an object | ||
*/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid spaces in between comments and code.
/** | ||
* This is an interface to provide an object's printable representation. | ||
*/ | ||
public interface Printable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job in remembering to write comments for the new interface.
@@ -82,4 +68,12 @@ default String getAsTextHidePrivate() { | |||
} | |||
return builder.toString(); | |||
} | |||
|
|||
default String getPrintableString(Printable... printables) { | |||
StringJoiner sj = new StringJoiner(" "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StringBuilder or StringJoiner can both be used. Good that one of the mentioned is used here.
Add a Printable interface [LO-Interfaces]