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
Mycal Grayson
157 PointsHow can one save in Java?
I may have missed some information in the Introductory portion of Java, but how can one save to Java again?
Mycal Grayson
157 Pointsmichaelcodes Thanks for replying. What I meant was, prior to compiling your code, how do you save your code. Sharina Jones actually provided me the answer I needed. I thank you both for your help.
1 Answer
Sharina Jones
Courses Plus Student 18,771 PointsTo save, if you're using workspaces, just press Ctrl + S on Windows or CMD + S on a Mac.
After you save, you have to recompile your program. To compile your program, from the command box, type javac ProgramName.java. For example, if your program is called Hello, to compile it, you type javac Hello.java
Once the program is compiled, you can run it. To run the program, type java Program. Notice that you don't include .java at the end. If you've compile your Hello program, you would run it by typing java Hello.
michaelcodes
5,604 Pointsmichaelcodes
5,604 PointsHi there! Could you please clarify the question a bit on what you mean by save to Java?