I’m a Java noob. I’ve only used it for a few days and I’m still trying to figure it all out. In a program, is a line the same thing as a statement?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No. The Java compiler doesn’t look at lines, spacing, or other formatting issues when compiling a program. It just wants to see the
;at the end of each statement. This line would work just fine:However, doing things like this can–and most likely will–cause readability issues with the source code. For this reason, it isn’t recommended.
It is also possible for a single statement to span multiple lines: