![jgrasp line numbers jgrasp line numbers](https://www.buildingjavaprograms.com/labs/1/jgrasp-run.png)
Java expressions work in the exact same way, and the nomenclature of “expression” comes from the same source. Mathematically, the expression 2 + 3 states to add 2 and 3 together, and the produced result of the expression is 5. This is no different from the sort of mathematical expressions you're used to, such as 2 + 3.
![jgrasp line numbers jgrasp line numbers](https://www.howtogeek.com/wp-content/uploads/2020/01/Word-Line-Numbers-Each-Page-Edit.png)
However, expressions and statements differ in exactly what they produce.Įxpressions do something, and then produce some sort of value as a result. In being executable, both expressions and statements do something.
JGRASP LINE NUMBERS CODE
The part of your code which actually runs is divided into expressions and statements. With this in mind, word processors are altogether the wrong tools with which to edit code.Ĭomponents of Executable Java Code: Expressions and Statements In fact, a particularly aggressive word processor may try to “autocorrect” something which is syntactically valid (but strange-looking) into something invalid (but better-looking). Word processors, in contrast, lack these features. These features make code easier to read and write on a text editor. This means that text editors can do things like highlight your code and even automatically structure it. formatted text, text editors generally better understand the syntax of programming languages. This is why word processors generally don't use plain text: they want to add in extra formatting which makes things easier for humans to read, but more difficult for a computer to understand.įor example, word processors will try to make explicit left and right double quotes (i.e., “ ”), whereas text editors will use the same double quote character either way (i.e., ").īeyond plain vs. Word processors are meant for writing things for humans. This is why text editors are based around plain text: the text itself should be as simple as possible in structure to facilitate easy reading for both parties.
![jgrasp line numbers jgrasp line numbers](https://www.buildingjavaprograms.com/labs/1/jgrasp-compile.png)
Text editors are meant for writing things that can be read by both humans and computers, including code. Word processors (e.g., Microsoft Word, Google Docs) generally don't give you plain text out of the box, and if you use these you'll need to explicitly have them save as plain text. ) will give you plain text straight out of the box. Text editors (e.g., jGrasp, emacs, vi, vim, Sublime Text, Atom. Java code must be written in plain text, which is true of most programming languages. This guide is intended to be applicable throughout the duration of the course, so it is not expected that you'll be able to understand every single bit of it all at once.įor example, while the meaning of a comma ( ,) in Java code is discussed, we won't be seeing commas until later in the course. This is focused on the syntax and structure of Java code, not on the semantics (behavior) of the code. This guide goes through some of the mechanical elements of writing Java. Short Guide on Writing Java Short Guide on Writing Java