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) Harnessing the Power of Objects Helper Methods and Conditionals

Manish Giri
Manish Giri
16,266 Points

Why is REPL being used?

I don't really understand the need of using REPL in the lectures. What's the point? Everything could have been used simply in the workspace console, without complicating things unnecessarily.

4 Answers

REPL is a quick and easy way to test JAVA code without the need to compile and run each time. Not that it takes very long, but it helps show how certain functions and commands work in JAVA.

Pauliina K
Pauliina K
1,973 Points

You don't -have to- use the REPL. It's basically just used to test Java code and in the lectures it's often used to show what certain functions or other things new to us look like. It's just a quicker way than doing it in the workspace console!

kabir k
PLUS
kabir k
Courses Plus Student 18,036 Points

REPL (read-eval-print loop) is a way to explore and interact directly with bits and pieces of your Java code (like single expressions) so you don't have to compile and run your files every time you want to test a code.

I'm curious if there's such a thing as a "real time" testing environment for Java, meaning that when I write the code I can see the results immediately vs. having to use something like REPL. I know that the compiling process is the thing that slows down the results of your current code, but is there no way around this? Or no way to speed up the compilation?