Notebooks enable literate programming. This is the mix of narrative about what is being done with the code and code results.
Notebooks allow you do explore a topic and doucment that topic. For examples, see my articles on Medium.
In contrast, code exists only as code. Unlike a notebook, documentation and narrative is separate from code.
I use Python notebooks to explore topics in computational finance. I use Java code for building applications and libraries.