Learning Java: How to make a short alias for System.out.println() -


i make alias of or extended version of system.out.println() printing variables of various types. how 1 pass argument unknown type/class method?

public static void p(variabletype... args) {     system.out.println(args[0]);     // ... } 

unless want lots of lines in output, do.

public static <printabletostring> void p(printabletostring... args) {     for(printabletostring pts: args)         system.out.print(pts);     system.out.println(); } 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -