Page 1 of 1

Java: Printing and Comments

Posted: Sun Aug 10, 2025 6:41 pm
by The Jason

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)