Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Java Objects Harnessing the Power of Objects Constants

Is this a better way of using 'System.out.print'?

public static void main(String[] args) { m("Hello world!%n"); }

public static String m(String message) { System.out.printf(message); return message; }


So you don't have to retype System.out.println("text"); everytime?

1 Answer

Stuart Wright
Stuart Wright
41,118 Points

In the Java course, 'Local Development Environments' (https://teamtreehouse.com/library/local-development-environments), you'll be introduced to software that allows you to create Java projects on your own machine, rather than using Workspaces. These local development environments have handy keyboard shortcuts which make common statements like the above much quicker (e.g. you just type 'sout' and it knows you mean 'System.out.println()').

I'm not aware of any easier way to do this using Workspaces I'm afraid, but just know that if you stick with the Java track you'll get to the part where he introduces shortcuts eventually (he even apologises for making you type out all that code!).