Lest's Start JAVA Programming
Part 2
Computer Variables
- Computer variable is a space created inside the RAM to store some data. it can be small space, big space but variable is some space created to store some data in computer RAM.
- Before we use a variable to do something we need to insert values to it. without insert values first we can't use the variable.
- If we insert values two times to the same variable if will overwrite the first value when we insert second value.
- Variables have names, when we creating them we give name to variable. but we can't create two or more variables in same name. eg:- variable name is like identity number of a person, we can't have two peoples with two identity number.
Let see this in JAVA code
Example 01.
Example 02.
This JAVA code will not compile, because there is no value assign for variable 'x' before print it value.
Example 03.
How is addition ( + ) works.
Addition work in two ways.
Comments
Post a Comment