Page 1 of 1

Java: Variables

Posted: Mon Aug 11, 2025 3:15 am
by The Jason

Code: Select all

// The data-type must be declared.

/* Variables can have letters, digits, underscores and dollar signs.  They cannot start with a digit */

int IntRightBefore3 = 2;

// Integer variable holding the number 2 declared.

System.output.println(IntRightBefore3);

// Prints out "2".

Code: Select all

float GPA_ = 4.0

String ForumName$ = "Hosting Chatter";