Skip to main content

Let's Start Java Programming - [Part 02]

 


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.
  1. adding numbers together.
  2. String concat. - Creating one string by connecting two or more strings.

 Example 01.

Comments

Popular Posts

What is a Computer Program ?

Let's Start JAVA Programming - [Part 01]

Lest's Start JAVA Programming - [Part 04]