Java: Variables

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

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";

 

POSTREACT(ions) SUMMARY

Post Reply