At this point we only discussed the structure OUT-side of the Class, as shown on, “what is Java”.
However, for a regular schoolproject it is also necessary to have a structure in your text (think of: Introduction, Body, Conclusion). This page will discuss the structure that you use IN-side the class.As you call the text blocks in your essays a paragraph, you call the text blocks in Java: methods. Paragraphs and methods have the same purpose. A paragraph and method both breaks the text into sub-topics.
Example
JAVA | ESSAY |
I made a game, in which you’ve to raise a dog | I wrote a book, in which I describe how my dog behaves |
In this game the user can click:
I write these different points in different methods |
In my book I described:
I write these different points in different paragraphs |
THEORY
Try while coding, to work as much in sub-topics as possible. As a programmer would say, work at much in methods as possible. Writing everything in ONE method can result in unreadable code.
Therefore, DON’T
At the top of previous page I made it look like, a method is a block. That is for you visualisation. If you zoom-in. It has an structure.