Hello World with Comments – CSKC
Sign In

Search

Code Learning #JAVA#553    siteicon   siteicon  

Hello World with Comments

This is a program that will tell us the use of comments in a code.

Learning Objectives

To learn java concepts related to :

  • Multi-line comments
  • Single line comments

Program Approach

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//.

Source Code

TC++ #553

Source Code

×

Ask AI About This Code

Default Prompt that is passed along with the code is given below, You can write your own prompt if you so desire.



×

Test Java

Code Understanding

/* 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



Share

Created: 16-Aug-2016 10:46 | Updated: 16-Jun-2026 18:51|