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!
In questa pagina del sito puoi guardare il video online Java Tutorial #4: Data Types and Variables della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Pink Code 01 agosto 2017, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 34 volte e gli è piaciuto 1 spettatori. Buona visione!