Write down the output of the following programs: a. class try { public static void main (String args[ ]) { System. out. print("Welcome"); System.out.print("to"); System.out.print("my home"); } }
Answers
Answer:
Common Programming Error 2.1common-program.jpg
Forgetting one of the delimiters of a traditional or Javadoc comment is a syntax error. A syntax error occurs when the compiler encounters code that violates Java's language rules (i.e., its syntax). These rules are similar to a natural language's grammar rules specifying sentence structure. Syntax errors are also called compiler errors, compile-time errors or compilation errors, because the compiler detects them during the compilation phase. The compiler responds by issuing an error message and preventing your program from compiling.
Good Programming Practice 2.1good-program.jpg
Some organizations require that every program begin with a comment that states the purpose of the program and the author, date and time when the program was last modified.
Using Blank Lines
Line 3 is a blank line. Blank lines, space characters and tabs make programs easier to read. Together, they're known as white space (or whitespace). The compiler ignores white space.