Java Tutorial #4: Data Types and Variables

Опубликовано: 01 Август 2017
на канале: 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!


На этой странице сайта вы можете посмотреть видео онлайн Java Tutorial #4: Data Types and Variables длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Pink Code 01 Август 2017, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 34 раз и оно понравилось 1 зрителям. Приятного просмотра!