0% found this document useful (0 votes)
6 views1 page

Java Variables Assignment 1

The document provides an example of a Java program that stores and prints various data about a high school student, including their name, ID, age, fee, and grade. It demonstrates the use of different variable types such as String, int, float, and char. The code is intended for users to copy and try out themselves.

Uploaded by

mandla.sithole
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

Java Variables Assignment 1

The document provides an example of a Java program that stores and prints various data about a high school student, including their name, ID, age, fee, and grade. It demonstrates the use of different variable types such as String, int, float, and char. The code is intended for users to copy and try out themselves.

Uploaded by

mandla.sithole
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Java Real-Life

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

You might also like