Java Variables Assignment 1
Java Variables Assignment 1
Java Variables
Example 1
Here is an example of a // Student data
program that stores different String studentName = "John Doe";
data about a high school int studentID = 15;
int studentAge = 23;
student float studentFee = 75.25f;
char studentGrade = 'B’;
Copy the code – try it!
// Print variables
System.out.println("Student name: " + studentName);
System.out.println("Student id: " + studentID);
System.out.println("Student age: " + studentAge);
System.out.println("Student fee: " + studentFee);
System.out.println("Student grade: " + studentGrade);
STEM