Skip to content

Instantly share code, notes, and snippets.

@om26er
Created September 15, 2020 11:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save om26er/a92936bed567b01294b059c533f76eb2 to your computer and use it in GitHub Desktop.
Save om26er/a92936bed567b01294b059c533f76eb2 to your computer and use it in GitHub Desktop.
Java print function like Python
private void print(Object ...args) {
StringBuilder builder = new StringBuilder();
for (int i = 0; i < args.length; i++) {
if (i == args.length - 1) {
builder.append(args[i]);
} else {
builder.append(args[i]).append(" ");
}
}
System.out.println(builder.toString());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment