Hello World 1 – CSKC
Sign In

Search

Code Learning #JAVA#535    siteicon   siteicon  

Hello World 1

This is a program to learn console output with and without newline.

Learning Objectives

To learn java concepts related to :

  • Difference between print() and println() method for showing the output to console.

Program Approach

The objective is to demonstrate console output using multiple print or println methods.

Since we want that the second output should come adjacent to the first one we will use theprint() method in the first statement but in the second statement we will use println() as we want the other outputs to be displayed in the next line.

Source Code

TC++ #535

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

System.out.print(β€œHello β€œ);

In this statement we have not used println() method, instead we have used print() as we want the next output to be displayed in the same line.

System.out.println(β€œWorld!”);

In this statement we have used the method println() as we want the other outputs to be displayed in the next line.


Suggested Filename(s): HelloWorld1.java



Share

Created: 13-Aug-2016 13:13 | Updated: 16-Jun-2026 18:52|