| [ Web Proxy ] |
| Viewing: https://riptutorial.com/java/example/29409/variables | [Back] [Original] |
[logo rip]
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.
| Web Proxy Viewer | New URL | Original Page |