Java Language JShell Expressions

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

Within JShell, you can evaluate Java expressions, with or without semicolons. These can range from basic expressions and statements to more complex ones:

jshell> 4+2
jshell> System.out.printf("I am %d years old.\n", 421)

Loops and conditionals are fine, too:

jshell> for (int i = 0; i<3; i++) {
   ...> System.out.println(i);
   ...> }

It is important to note that expressions within blocks must have semicolons!



Got any Java Language Question?