Right click and Open with … should the opening behavior in eclipse. Furthermore you can set the behavior in Preferences >> General >> Editors >> File Associations.
The main reason you’d do this is to decouple your code from a specific implementation of the interface. When you write your code like this:
We heard a lot about REPL when we were developing AngularJS app or NodeJS app. Which works on Read-Evaluate-Print-Loop mechanism. Java Shell tool is an interactive