Hot Student Stories
top-5-grammar-and-spelling-checkers-to-rock-in-2019

Can java code be broken in different lines?

Jeffrey Rodriguez

in Studying

follow
followin
1 answer
0 views

1 answer


Roger Moore on July 23, 2020

Yes. The end of an instruction is specified by a semicolon; you do NOT by the end of the line. Therefore, each of the following are equivalent, and equally valid: x = y + z; x = y + z; x = y + z; But please, try to make the code readable. There really is no need to separate out a brief statement - as the example above - in several lines; but the instructions, which are wider than the screen can be divided, so that the programmer can read them without having to scroll sideways.


Add you answer