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 Abstraction at Play

Jshell and REPL use requirement?

Craig,

I am following along quite nicely and not having really any issues, however, I had one small question or two.

Is it a requirement to learn Jshell and REPL to learn Java itself? From what I am gathering is that they are both just useful tools to use in cahoots with writing Java. Can you tell me the purpose of spending the time we are on being instructed to use Jshell and REPL, instead of on purely Java stuff?

Also, if someone is planning on using IDEs and such in the future once that person is all proficient in the language and the chosen IDE environment, will Jshell and REPL really have a big impact on what that person is doing later on?

I know some people will use them both, and some won't. I came to learn Java and sometimes I get the feeling that the time I have spent so far in REPL and Jshell has either taken away from time from learning the language itself, or has contributed a bit to a small amount of confusion that I have had to figure my way out of.

Not at all trying to bash either of them if ya'll are for some reason trying to promote them. Just curious what is the practical use of them, and what is the likelihood highly experienced java programmers use these day in/day out when they have the IDEs and such.

Thanks..

2 Answers

Alexander Lebedev
Alexander Lebedev
5,875 Points

Michael, Hi!

I will do my best to answer all your questions. First of all, let me remind you that Jshell / REPL was developed for fast explanation or checking of logic and features of some Java methods or logic of an app, avoiding following mandatory compile rules.

Of course, it is not required to learn how to work with REPL or Jshell to learn Java itself, but it is crucial to learn and understand the logic and behaviour of things, which Craig shows in Jshell. I'm talking about thingls like, how boolean logic works, index starts from 0 thing, how basic methods work etc. I am sure, that everyone will agree that these things, which are btw purely Java stuff are fundamental in learning and understanding of Java. If things that Craig shows to you in Jshell are 100% simple and clear, that's great, just skip it and go on.

Personally, I am not using neither Treehouse Workspace nor Jshell for coding course projects, I am using different IDE known as IntelliJ IDEA, so to test any concept I prefer to write the whole code following compile rules.

Conclusion: Jshell or REPL - is a TOOL, which was designed for really fast checking of any concept, logic. If you feel confused using this tool, just don't use it, it is not obligatory and doesn't impact on anything.

Teja Tummalapalli
Teja Tummalapalli
5,592 Points

small correction , jsell would be part of Java 9. https://blogs.oracle.com/java/jshell-and-repl-in-java-9

I agree with your other comments.

Alexander Lebedev
Alexander Lebedev
5,875 Points

Thanks Teja! Didn't know that. Made some changes.