datatypes in java| Rules of Variable in java
In this tutorial, I will introduce you to about what are variables, What are data and their types. I will also introduce you about datatypes in java. How to declare and initialize a variable in Java.
It is the memory location where we store data
Collection of Raw forms of facts and figures is called data. Data are something that is in an irregular form.
Types of Data:
Following are the different types of data:
datatypes in java:
float number =45.45f You should use f with float values in java.
String = value within double quotes
int a = variable declarations ( means to reserve memory)
a=45; variable initialization (means to give some value)
Variable Rules in Java
1. Alphabetic, Number,$ cannot be used in variable names.
2.Cannot start from No.
3. Space is not Allowed.
4. The same Name cannot be used.
5. Keywords cannot be used.
7. Should be in camelCase shahabMehmood Whose first alphabet is small and another is Capital khanBahadarKhan
CricketBoard == pascal case whose first word is large and second is small.
nextInt() for int;
nextline() for string;
nextDouble() for double;
nextfloat() for float;