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

Variable and Data Type in Java

PLEASE LIKE, COMMENT, SUBSCRIBE AND SHARE OUR CHANNEL.

For any suggestion or feedback please type in comment section.

******************************************************
NOTES
******************************************************

Variable

Variable: We can understand variable as a container which holds
the value while the java program is executed. Variable is name

of reserved area allocated in memory.
Syntax: data_type variable_name = value;
Example: int number=20;

Rules of declaration of a variable:

1. Java variable names are case sensitive.
2. Java variable names must start with a letter, or the $ or _

character.
3. Blank spaces cannot be used in variable names.
4. Java keywords cannot be used as variable names.
5. A variable name can consist of Capital letters A-Z, lowercase

letters a-z, digits 0-9, and two special characters such as
underscore and dollar Sign.

Note: The variable name needs to be chosen by the programmer

in a meaningful way so that it reflects what it is representing a
program.

DIFFERENT TYPES OF VARIABLE: There are 3 types of variable in

java. They are -
1. Local Variable: A variable defined within a block or method or

constructor is called local variable.These variable are created
when the block in entered or the function is called and
destroyed after exiting from the block or when the call returns
from the function.The scope of these variables exists only within
the block in which the variable is declared. i.e. we can access
these variable only within that block.Initilisation of Local
Variable is Mandatory.

2. Instance Variables: Instance variables are non-static

variables and are declared in a class outside any method,
constructor or block. As instance variables are declared in a
class, these variables are created when an object of the class is
created and destroyed when the object is destroyed. Unlike local
variables, we may use access specifiers for instance variables. If
we do not specify any access specifier then the default access
specifier will be used. Initilisation of Instance Variable is not
Mandatory. Its default value is 0. Instance Variable can be
accessed only by creating objects.

3. Static variables are also known as Class variables. These

variables are declared similarly as instance variables, the
difference is that static variables are declared using the static
keyword within a class outside any method constructor or block.
Unlike instance variables, we can only have one copy of a static

variable per class irrespective of how many objects we create.
Static variables are created at the start of program execution

and destroyed automatically when execution ends. Initilisation
of Static Variable is not Mandatory. Its default value is 0. If we
access the static variable like Instance variable (through an
object), the compiler will show the warning message and it
won’t halt the program. The compiler will replace the object
name to class name automatically. If we access the static
variable without the class name, Compiler will automatically
append the class name.

DATA TYPES
DEFINITION:Data types specify the different sizes and values

that can be stored in the variable.

TYPES OF DATA TYPES: There are two types of data types in

Java:

Primitive data types: The primitive data types include boolean,

char, byte, short, int, long, float and double.
Non-primitive data types: The non-primitive data types include

Classes, Interfaces, and Arrays.

There are 8 types of primitive data types:

boolean data type
byte data type
char data type
short data type
int data type
long data type
float data type
double data type


******************************************************
SOURCE
******************************************************
Data Types: https://www.geeksforgeeks.org/data-types-in-java/
Variables: https://www.geeksforgeeks.org/data-types-in-java/

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

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

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

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