Загрузка...

How To Declare a Variable - Java Tutorial For Absolute Beginners

In this video I am discussing on the topic of Variables in Java Variables are nothing but reserved memory locations to store values. It is actually a container that holds value for you, during the life of a Java program. What we need to know when declaring a variable • Every variable must have a data type which determines the type and range of values it can contain. • The value stored in a variable can be changed during program execution. • A variable is only a name given to a memory location; all the operations done on the variable affects that memory location. • In Java, all the variables must be declared before being used. That means that in order to use a variable in a program you to need to declare it first Examples of valid variable declarations are: int age; float pi; double d; char a; String car; int a,b,c; // Another way to declare multiple variables having the same data type (make sure the variable names are separated by a comma) All variables can only hold one value at a time and are declared pretty much the same way except Arrays String [] names; // Arrays are used to store multiple values in a single variable, instead of declaring separate variables for each value Please Subscribe!!!! #codingriver #variabledeclarationinjava #javatutorial

Видео How To Declare a Variable - Java Tutorial For Absolute Beginners автора Java Guru: станьте настоящим мастером
Страницу в закладки Мои закладки
Все заметки Новая заметка Страницу в заметки