Java: Printing and Comments

Post Reply
User avatar
Jason
Site Admin
Posts: 853
Joined: Tue Jul 01, 2025 10:13 am

Code: Select all

System.out.printin("Welcome to Hosting Chatter");

// This is a one-line comment.

/* This is a multi-line comment
and this is the 2nd line. */

System out.printf("Welcome to Hosting Chatter.")

// The above method can also reference variables.

int SumOf1Plus1 = 2;

System.out.printf("1 + 1 = %d.%n, Sumof1Plus1)

 

POSTREACT(ions) SUMMARY

Post Reply