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

Tutorial 2 - Datatypes and Variables in JAVA | xstechie

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

Download here ?
JDK - https://www.oracle.com/java/technolog...
Intellij IDE - https://www.jetbrains.com/idea/downlo...

Source Code - https://www.mediafire.com/file/2nnvctn046ohiie/DatatypeAndVariables.java/file

Chapter 1 Notes - https://www.mediafire.com/file/ztio72qph4agtdu/Chapter_1.pdf/file

My Social -- ?
Instagram - https://www.instagram.com/xstechie/
Telegram - https://t.me/+R0N5xNphR79hYWFl

About Tutorial ?

Variables
A variable is a container that store a value. This value can be changed during the execution of the program.
Ex - int number = 8 ;

Rules for declaring a variable name we can choose a name while declaring a JAVA variable if the following rules are followed:
1. Must not begin with a digit int 1arr is invalid!
2. Name is case sensitive xstechie and Xstechie are different
3. Should not be a keyword like ( void , static )
4. White space not allowed int xs techie ; invalid
5. Can contain alphabet ,$character , _character, digit, if the other condition are met

Data Types
Data Type in JAVA fall under the following categories
1. Primitive Data Type ( Interis )
2. Non - primitive Data Type ( Derived)
Primitivie Data Type
There are 8 primitive data type supported by JAVA
1. byte - Value ranges from -128 to 127
Takes 1 byte
Default value is 0.


2. Short - Value ranges from – ( 2
16 )/2 to ( 2 )
16/2 -1
Takes 1 byte
Default value is 0.
3. Int - Value ranges from – ( 2
32 )/2 to ( 2 )
32/2 -1
Takes 4 byte
Default value is 0.
4. Float - Value ranges from – ( see JAVA docs )
Takes 4 byte
Default value is 0.0F
5. Long - Value ranges from – ( 2
64 )/2 to ( 2
64 )/2 -1
Takes 8 byte
Default value is 0.0l
6. Double - Value ranges from – ( see Docs )
Takes 8 byte
Default value is 0.0d
7. Char - Value ranges from – 0 to 65535( 2
10
-1 )
Takes 2 byte
Default value is 0.
8. Boolean - Value can be true or false
Size depend on JUM
Default value is False.

Datatype Code
byte age = 34;
int age2 = 56;
short age3 = 87;
long ageDino = 56666666666L;
char character = ‘ A ’;
Float F1 = 5.6f;
Double d1 = 4.66D;
Boolean a = true;


How to choose Datatypes for our variables
Primitive Data Types
Integral( int ) Float( Decimal ) char ( ‘ ’) Boolean (true or false)
Bytes ,short ,int,long(L) ( float , Double )
( F,f ) ( D,d )
In order to choose the datatype we first need to find the type of data we want to store . After that
we need to analyse the min & max value we might use .
Literals
A constant value which can be assigned to the variables is called as a literal
101 integer literal
10.1f float literal
10.1 double literal ( default type for decimal )
‘ A ’ character literal
True Boolean literal
“xstechie” String literal
Keyword
Words which are reserved and used by the JAVA compiler .They cannot be used as an
Identifier.
See docs for more


Reading data from the keyboard
In order to read data from keyboard . JAVA has a Scanner Class
Scanner class has a lot of method to read the data from the keyboard
Scanner s – new Scanner ( System.in );
Int a = s.nextInt( ); Read from the Keyboard
M

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Tutorial 2 - Datatypes and Variables in JAVA | xstechie», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

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

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

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