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 (Retired) Meet Objects Welcome Back

Adam Sawicki
Adam Sawicki
15,967 Points

Java-REPL

Could you give me an idea, what I can use java-repl for? Thanks ;p

5 Answers

Pavils Nikitins
Pavils Nikitins
410 Points

I've just watched the "Welcome Back" video, and I'm a bit confused as well. From what I understood, I guess you can use it to "test out" things before actually writing down any code in your actual project?

So for example, you have an idea for some logic you could implement, but instead of writing it down in the actual code, you could test it out in REPL?

I could be wrong, but that's what I understood from the "Welcome Back" video in Java Objects. Could anyone confirm/deny?

Pavils, you're basically right. If you've ever used the Python interpreter, then this is basically the same concept. If you want to quickly test some rough ideas without having to waste time in creating a whole .java file, compiling it, troubleshooting possible errors, and then having to edit and re-compile., then the java-repl is for you.

Scott Adams : However, isn't that what the Workspaces before the REPL was also capable of doing? I'm still not sure what value the REPL adds to the Workspaces we used from the Java Basics course.

I would say that if your using Workspaces as an IDE for your personal projects, rather than locally, then the value here is that if you want to test out something in Java, the REPL is available for you.

Darryl Soerdjpal
Darryl Soerdjpal
740 Points

From what I have gathered, you will mostly use an IDE when you start your own projects. IDE's are explained in another course within the Java track.

So in short: you might not find REPL as useful in a fully featured IDE like Intellij IDEA, but it is useful in the workspace environment that is provided here.

Well, you have access to a terminal in an IDE, and the java-repl is accessed within the terminal, therefore it is useful if you want to test out a rough idea of yours...

Darryl Soerdjpal
Darryl Soerdjpal
740 Points

That is absolutely true. I just find it less useful personally. Hopefully that clears things up! :)