MEDoctor ready to Launch DocBooking.ch. A Unique Doctor Booking System, with Artificial Intelligence and BlockChain Health Record Included. We are looking for Early Investors — Immediate…
Variables are used to store the data and we need to follow 2 instructions to store the data.
1] Variable declaration
we are declaring the variable name for the memory block to store the data.
e.g String name, int count
2] Variable initialization
we can initialize the value to a variable.
e.g String name = “Java”, int n = 10
>> Classification of variables
Based on the data types used we have two types.
1] Primitive variable:
if we declare the variables for the primitive data types, then the variable is a primitive variable.
e.g double d, char ch
2] Non-Primitive Variable
If declare the variables for the non-primitive data types, then the variable is non-primitive variable.
e.x String s; // s is a non-primitve variable
Based on the visibility or scope of the variable we have two types
a] Local variables
Declared within a particular method block. It cannot be used outside the block.
b] Global Variables
Declared within the class block but outside the method block this variable can be used anywhere within the class and method.
Rules to be used Local variables :
1] Local variable must be used after its declaration and initialization.
2] Local variables can be reinitialized any number of times.
3] We can not have two or more local variables with the same name.
Note: Whenever we use the variables in the program then the value present within the variables will be used always.
Once we declare a variable we can re-initialize the variables any number of times.
Perils of The Modern Human, a Medium series by Mark Johns
Accessories can make or break your outfit. The right jewellery styling tips can transform even a simple ensemble into a stunning statement piece. Women and girls are spoilt for choice when it comes…
Ethics are an essential component of an organization and define how that organization operates. As an organization matures and scales they often warp their own ethical climate by enacting too much…