Hello World with Comments
This is a program that will tell us the use of comments in a code.
To learn java concepts related to :
- Multi-line comments
- Single line comments
To learn putting comments for the purpose of documentation. These comments enhance readability of the program but they are not executed nor they have any effect on the output of the program. For multi-line comments we shall use /*..*/ while for the single-line comments we will use//.
/* A program to show the purpose of comments Author: ComputerSirKiClass */
This is a multi line comment. Whenever we give a multi line comment we use /* (front slash-asterisk) in the beginning and */(asterisk-front slash) in the end. Multi-line commenting tags are also helpful to comment anything within a program code.
System.out.println(“Hello World”);//Method for output to console
Use of double front slash(front solidus) makes it a single line comment. Anything after double slash is ignored. // can not be used for inline commenting within the code.
Suggested Filename(s): HelloWorldC.java
admin| Created: 16-Aug-2016 | Updated: 8-Dec-2017|