Variables

suggest change

You can declare local variables within JShell:

jshell> String s = "hi"
jshell> int i = s.length

Keep in mind that variables can be redeclared with different types; this is perfectly valid in JShell:

jshell> String var = "hi"
jshell> int var = 3

To see a list of variables, enter /vars at the JShell prompt.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents