Download presentation
Presentation is loading. Please wait.
1
Unit-1 Introduction to Java
Variables
2
Variables A variable is used to store a data that can change as the program executes. Variables are labels that describe a particular location in memory and associate it with a data type.
3
How to initialize variables
4
constants A constant is used to store a data that can’t be changed as the program executes, and many of the skills for initializing variables also apply to initializing constants.
5
How to initialize constants
many of the skills for initializing variables also apply to initializing constants. However, you begin the initialization statement for a constant with the final keyword. As a result, constants are sometimes called final variables. In addition, it’s a common coding convention to use all uppercase letters for the name of a constant and to separate the words in a constant name with underscores.
6
Rules For Naming VARIABLES
7
Variable assignment statement
8
Example Of Variable Declaration And Assignment
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.