Chapter 2 - Introduction to Java applications. After studying this chapter you will be able to understand: To write simple Java applications, to use input and output statements, Javas primitive types, basic memory concepts, to use arithmetic operators, the precedence of arithmetic operators, to write decision-making statements, to use relational and equality operators. | Java™ How to Program, 8/e (C) 2010 Pearson Education, Inc. All rights reserved. (C) 2010 Pearson Education, Inc. All rights reserved. (C) 2010 Pearson Education, Inc. All rights reserved. Java application programming Use tools from the JDK to compile and run programs. Videos at Help you get started with Eclipse and NetBeans integrated development environments. (C) 2010 Pearson Education, Inc. All rights reserved. Java application A computer program that executes when you use the java command to launch the Java Virtual Machine (JVM). Sample program in Fig. displays a line of text. (C) 2010 Pearson Education, Inc. All rights reserved. (C) 2010 Pearson Education, Inc. All rights reserved. Comments // Fig. : // indicates that the line is a comment. Used to document programs and improve their readability. Compiler ignores comments. A comment that begins with // is an end-of-line comment—it terminates at the end of the | Java™ How to Program, 8/e (C) 2010 Pearson Education, Inc. All rights reserved. (C) 2010 Pearson Education, Inc. All rights reserved. (C) 2010 Pearson Education, Inc. All rights reserved. Java application programming Use tools from the JDK to compile and run programs. Videos at Help you get started with Eclipse and NetBeans integrated development environments. (C) 2010 Pearson Education, Inc. All rights reserved. Java application A computer program that executes when you use the java command to launch the Java Virtual Machine (JVM). Sample program in Fig. displays a line of text. (C) 2010 Pearson Education, Inc. All rights reserved. (C) 2010 Pearson Education, Inc. All rights reserved. Comments // Fig. : // indicates that the line is a comment. Used to document programs and improve their readability. Compiler ignores comments. A comment that begins with // is an end-of-line comment—it terminates at the end of the line on which it appears. Traditional comment, can be spread over several lines as in /* This is a traditional comment. It can be split over multiple lines */ This type of comment begins with /* and ends with */. All text between the delimiters is ignored by the compiler. (C) 2010 Pearson Education, Inc. All rights reserved. Javadoc comments Delimited by /** and */. All text between the Javadoc comment delimiters is ignored by the compiler. Enable you to embed program documentation directly in your programs. The javadoc utility program (Appendix M) reads Javadoc comments and uses them to prepare your program’s documentation in HTML format. (C) 2010 Pearson Education, Inc. All rights reserved. (C) 2010 Pearson Education, Inc. All rights reserved. (C) 2010 Pearson Education, Inc. All rights reserved. Blank lines and space characters Make programs easier to read. Blank lines, spaces and tabs are known as white space (or whitespace). White space is ignored by the .