WEBVTT

00:00.000 --> 00:05.000
Variables and Data Types

00:05.000 --> 00:07.000
In this video we will learn

00:07.000 --> 00:10.000
what are variables and data types

00:10.000 --> 00:14.000
Basic arithmetic operations

00:14.000 --> 00:16.000
Introduction

00:16.000 --> 00:20.000
Variables and Java are like containers that hold data

00:20.000 --> 00:23.000
Each with a name and a value

00:23.000 --> 00:27.000
Data types define the kind of data a variable can store

00:27.000 --> 00:31.000
Like numbers, decimals, characters, and true or false

00:31.000 --> 00:34.000
Let's understand this with the help of the code

00:34.000 --> 00:37.000
Understanding variables and data types

00:37.000 --> 00:42.000
Here we create a variable named Age of Type Int, integer

00:42.000 --> 00:45.000
And give it the value 15

00:45.000 --> 00:49.000
The program prints age 15

00:49.000 --> 00:52.000
Here in stores whole numbers like 10

00:52.000 --> 00:56.000
Double stores decimal values like 5.99

00:56.000 --> 01:02.000
Charge stores a single character like A, Boolean stores, true or false

01:02.000 --> 01:05.000
Arithmetic operations

01:05.000 --> 01:09.000
This section shows how we can do math operations with variables

01:09.000 --> 01:12.000
Here we have given our variables values

01:12.000 --> 01:18.000
Variable A has the value 10 and variable B has the value 5

01:18.000 --> 01:20.000
Understanding constants

01:20.000 --> 01:22.000
Constant is like a variable

01:22.000 --> 01:25.000
But once you give it a value, it can never be changed

01:25.000 --> 01:30.000
In Java we use the keyword final to make something a constant

01:30.000 --> 01:34.000
Here the keyword final means this value cannot change

01:34.000 --> 01:39.000
PI will always stay 3.14159

01:39.000 --> 01:43.000
Variables help us store data, data types define what kind of data

01:43.000 --> 01:46.000
And constants keep important values fixed

