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 trialDominic Mills
105 PointsI deleted intoductions.java and the class file off the sidebar and cant seem to get the pre written code back?
I deleted intoductions.java and the class file off the sidebar and cant seem to get the pre written code back? when i re opened workspace java basics-intro poped up again in the side bar but no pre written code had popped up in the main centre window
5 Answers
Kourosh Raeen
23,733 PointsHere's the code I have in that file:
import java.io.Console;
public class Introductions {
public static void main(String[] args) {
Console console = System.console();
// Welcome to the Introductions program! Your code goes below here
String firstName = console.readLine("What is your name? ");
console.printf("Hello, my name is %s\n", firstName);
console.printf("%s is learning how to write Java\n", firstName);
}
}
Just right click on the sidebar and create a new file with the name Introductions.java and paste the above code in there. Then compile and run it.
Uriah Nevins
1,121 PointsYou could also try deleting your workspace, then logging back on to workspaces via the exercise. That should give you a new one with all the code you need.
Dominic Mills
105 PointsI deleted workspaces and then tried to re open it and a message came up saying treehouse says un authorised ...basically computer says no
Dominic Mills
105 PointsThanks a million will give it a try now!
Dominic Mills
105 PointsFor some Reason it wont allow me to paste?
Uriah Nevins
1,121 Pointsundo, undo, undo, undo. :-)
Dominic Mills
105 PointsDominic Mills
105 PointsIt does not allow me to paste?