Java - Simplify System.out.print
G'afternoon, I posted this to someone else as a response, and figured that this may be useful to everyone that uses Java. Ask any questions if you need clarity. Hope it helps and feel free to add in any of your own tricks that you use for Java! What to expect: - Static import of System.out - Custom print() method - Custom println() method https://code.sololearn.com/cJD7V66TF3k7/#java // This import allows us to use out.println() // instead of having to use System.out.println() import static java.lang.System.out; public class Program { // custom function to simplify System.out.print public static void print(String str) { System.out.print(str); } // custom function to simplify System.out.println public static void println(String str) { System.out.println(str); } public static void main(String[] args) { // EXAMPLE OF PRINT FUNCTION print(":::PRINT FUNCTION EXAMPLE:::"); print("This "); print("Doesnt "); print("Print NewLine\n"); // EXAMPLE OF PRINTLN FUNCTION println(""); println(":::PRINTLN FUNCTION EXAMPLE:::"); println("This"); println("Prints"); println("With New Line"); // EXAMPLE OF SYSTEM.OUT IMPORT out.println(""); out.println(":::SYSTEM.OUT IMPORT EXAMPLE:::"); out.print("No New Line"); out.println(""); out.println("This"); out.println("Has"); out.println("NewLine"); } } Note: You can name your functions any valid name, so you could make the name even smaller, such as p() and pln(), or make it anything else you want. It's always a good rule of thumb to name things in a way that relates to its purpose, but if you don't have thumbs, do whatever you want. :D