Presentation is loading. Please wait.

Presentation is loading. Please wait.

Unit-1 Introduction to Java

Similar presentations


Presentation on theme: "Unit-1 Introduction to Java"— Presentation transcript:

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


Download ppt "Unit-1 Introduction to Java"

Similar presentations


Ads by Google