Member-only story

Coding 101: CS Variables Simplified

The Test Lead
2 min readSep 16, 2021

--

This article will try to simply the concept of variables in computer science programming. Imagine you are cleaning out your garage. You buy bags to help you organize everything. You can think of these as variables.

Photo by Maxim Selyuk on Unsplash

You put things of similar types into the same bag. You then label the bag so you know what type of items are in it.

Variables are simply locations of storage that hold information that you can use later.

Data Types

Just how you would label the different bags with names, you would label the variables with names called a data type.

Photo by FORTYTWO on Unsplash

Just like the bag label defines the things going into the bag, the data type defines the type of information that a variable could hold. Depending on the programming language that you use, you will see many different types of predefined data types such as “string”, “integer”, “character”, “Boolean”, “double”, and “float” for Java.

Declaring a variable

Before you can use a variable, you must declare it. See the below format.

--

--

The Test Lead
The Test Lead

Written by The Test Lead

Lead SDET at fintech company in NYC. Visit personal page http://thetestinglead.com// Twitter @juss_bailey Youtube @The Test Lead

No responses yet