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 trialSebastian García
959 PointsHi my name is Sebastian, I didin't understand what is the Jshell for?
In wich cases would I be using it?
4 Answers
Unsubscribed User
1,321 PointsHello Sebastian,
"The Java Shell tool (JShell) is an interactive tool for learning the Java programming language and prototyping Java code. JShell is a Read-Evaluate-Print Loop (REPL), which evaluates declarations, statements, and expressions as they are entered and immediately shows the results." - Oracle
To put it simply, it's like 'creative/sandbox mode' for Java. You are able to test out things without adding things to code your working on.
If you want to learn a bit more CLICK HERE to go to Oracles Introduction to JShell.
Ela Silaeva
1,581 PointsTo quickly test snippets of code. I used it for Reg Exes and Complicated expressions
kevin hudson
Courses Plus Student 11,987 PointsBut doesn't this only work for one line code? How in depth can you get with jshell?
Amirmasoud jalali
Courses Plus Student 947 Pointscan we use it for unit testing as well?
Codrin Postu
8,022 PointsCodrin Postu
8,022 PointsIt is used to learn the language and just test and prototype your program. When you enter a variable or do a command you do not need to compile the program and run it. It will do it automatically for you.
This is the official site from oracle it explains pretty well: https://docs.oracle.com/javase/9/jshell/introduction-jshell.htm#JSHEL-GUID-630F27C8-1195-4989-9F6B-2C51D46F52C8