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!
Auf dieser Seite können Sie das Online-Video Java Tutorial #4: Data Types and Variables mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Pink Code 01 August 2017 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 34 Mal angesehen und es wurde von 1 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!