RUVIDEO
Поделитесь видео 🙏

5.Data Types in Java Programming Language смотреть онлайн

📁 Обучение 👁️ 16 📅 05.12.2023

Java is considered as a strongly typed programming language. Thus all variables in the Java programming language ought to have a particular data type. This is either declared or inferred and the Java language only allows programs to run if they adhere to type constraints.

Primitive Data Types:
=================
Primitive types are the most basic data types available within the Java language; these include boolean, byte, char,short, int, long, float and double. These types serve as the building blocks of data manipulation in Java. Such types serve only one purpose containing pure, simple values of a kind. Because these data types are defined into the Java type system by default, they come with a number of operations predefined. You can not define a new operation for such primitive types.

There are eight primitive data types in Java. These are as follows:

1. Byte:
======
The byte data type is an 8-bit signed two's complement integer. It has a minimum value of -128 and a maximum value of 127 (inclusive). The byte data type can be useful for saving memory in large arrays, where the memory savings actually matters. They can also be used in place of int where their limits help to clarify your code; the fact that a variable's range is limited can serve as a form of documentation.

Minimum Value: -128 (2^7)

Maximum Value: 127 (2^7-1)

Default Value: 0

2. Short:
=======
A short is twice the size of a byte, i.e. it is made up of 16-bits. Its chief characteristics are:

Minimum Value: -32,768 (2^15)

Maximum Value: 32,767 (2^15-1)

Default Value: 0

3. Int:
====
An integer is four times the size of a byte (i.e. it is made up of 32 bits). It is one of the most commonly used data types in Java.

Minimum Value: -2,147,483,648 (2^31)

Maximum Value: 2,147,483,647 (2^31 – 1)

Default Value: 0

4. Long:
======
The long data type is a 64-bit two's complement integer. The signed long has a minimum value of -2^63 and a maximum value of 2^63-1. In Java SE 8 and later, you can use the long data type to represent an unsigned 64-bit long, which has a minimum value of 0 and a maximum value of 264-1. Use this data type when you need a range of values wider than those provided by int. The Long class also contains methods like compareUnsigned, divideUnsigned etc to support arithmetic operations for unsigned long.

Minimum Value: -9,223,372,036,854,775,808 (2^63)

Maximum Value: 9,223,372,036,854,775,807 (2^63 – 1)

Default Value: 0

Examples:

long x = 6778005876543

long y = -554233254242

5.Float
======
The float data type is a single-precision 32-bit IEEE 754 floating point. Its range of values is beyond the scope of this discussion, but is specified in the Floating-Point Types, Formats, and Values section of the Java Language Specification. As with the recommendations for byte and short, use a float (instead of double) if you need to save memory in large arrays of floating point numbers. This data type should never be used for precise values, such as currency. For that, you will need to use the java.math.BigDecimal class instead. Numbers and Strings covers BigDecimal and other useful classes provided by the Java platform.

Float Data type Covers a range from 1.40129846432481707e-45 to 3.40282346638528860e+38 (positive or negative).

6.Double
=======
The double data type is a double-precision 64-bit IEEE 754 floating point. Its range of values is beyond the scope of this discussion, but is specified in the Floating-Point Types, Formats, and Values section of the Java Language Specification. For decimal values, this data type is generally the default choice. As mentioned above, this data type should never be used for precise values, such as currency.

Dobule data type Covers a range from 4.94065645841246544e-324d to 1.79769313486231570e+308d (positive or negative).

7.Char
=====
Char data type refers to a single 16-bit Unicode character. Unicode is a computer industry standard for representing text related data. This includes alphabets, symbols ($, &, *, #, @, !, etc.), and special figures such as ¢, £, ¥, etc. The Unicode character set includes over 110,000 characters covering more than 100 language scripts.

8.Boolean:
========
Boolean is the smallest data type in Java, i.e. it is made up of only one bit. Thus, a Boolean data type can have only two values – 0 (or False) and 1 (or True).

Example:
=======
boolean x = true

boolean y = false

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «5.Data Types in Java Programming Language» бесплатно и без регистрации, вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.