Variables and Types - Learn Java
What are the variables in Java?
A Java variable is a piece of memory that can contain data value. A variable thus has data type. Data types are covered in more detail in the text on Java data types. Variables are typically used to store information.
Variables and Types
Although Java is object oriented, now not all kinds are objects. It is constructed on pinnacle of simple variable sorts known as primitives.
Here is a listing of all primitives in Java:
byte (number, 1 byte)
short (number, two bytes)
int (number, four bytes)
long (number, eight bytes)
float (float number, four bytes)
double (float number, eight bytes)
char (a character, two bytes)
boolean (true or false, 1 byte)
Java is a sturdy typed language, which capability variables want to be described earlier than we use them.
Post a Comment
Thanks for touching with us.