Java Tutorial #4: Data Types and Variables

Publicado em: 01 Agosto 2017
no canal de: Pink Code
34
1

Thanks for coming back! In this video we learn about data types and try our luck with a simple program to initiate variables. Data types are specifically used in java to identify the type of value a variable is being assigned (whether it is a number, integer, decimal, word, and its size). There are two types of data types (primitive and non primitive). The primitive data types include Boolean and also different byte value numbers depending on the size and whether it is a decimal or not. Decimals are called floating point integers and the 2 types are float (smaller) and double. The integer primitive values are byte, short, int, and long. The non primitive data types are String for a word or phrase, array for a list, and user defined classes. Assigning a small value to a long creates problems because it uses up too much space on the computer and assigning a long value to a smaller data type such as byte is non compatible since the there is not enough to store the value.

Variables can be changed (unless declared final) and are assigned a value. When initiating a variable write the data type and variable name. By default, initially all variables of data type short, byte, int, long are 0, Strings are null, and Boolean is false. To assign a value to a variable just use the assignment operator (a = sign).
Please subscribe!


Nesta página do site você pode assistir ao vídeo on-line Java Tutorial #4: Data Types and Variables duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Pink Code 01 Agosto 2017, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 34 vezes e gostou 1 espectadores. Boa visualização!