Welcome back in this chapter, you are going to learn the basics of coddling.
But before we go into that, we will check out the basic concepts of any old language and a copy of
our sins for object oriented programming.
And there are multiple different languages which are languages such as Java, C Sharp and, of course,
Kotlin.
There are plenty others as well.
So the five basic concepts are verbs and types.
Control flows, functions, collections and classes and hereby also objects, which of course, also
includes inheritance.
But generally, these are the five basic concepts, and you can find them in any object oriented programming
language.
And we're going to cover those throughout this chapter.
We're going to dig deeper into every single one of those concepts with many different examples.
And first of all, we are going to look at variables now.
What are variables?
Well, a variable is a location in memory.
So when you create a variable, it's stored on your computer somewhere.
And in order to indicate the storage area, each variable should be given a unique name.
So once you create a variable, you have to give it a unique name, which is also called identifier.
And you can access the data behind that point in the memory by using this name.
Now, let's have a look at this so we can see here from Maine, which is the main function.
Don't be confused by this.
This is really just the entry point.
If you create a codling application or Scotland program, then you have an entry point of your program
and that is your main function.
So this is just something that you will see every time when you create a Scotland program.
So we have fun Maine, and then we use this keyword called VAR and then the name of the variable, which
is called H in this case.
And then we can assign a value.
And in this case, I assign the value of 15.
And if I print that now, it will print 15 print lines dense for print lines.
So it's just going to print a line where it says 15, because that's the value of the variable that
I passed to this function called print the line again.
Don't be bothered by this.
This is really just an overview.
VIDEO We're going to dig deeper into this.
Once we go into practice mode, then we have control flows and control flows.
Allow us to do something conditionally, so only execute code if a certain condition is met and do stuff
repeatedly so repeatedly run code as long as a condition is met.
And this is very, very useful because there are multiple situations where you actually want to execute
a certain code on to something multiple times.
Here we have a quick example for a control flow so we can see we have a variable again called H and
it's set a 17.
And then the statement you may vote now will only be printed if the age is greater than 21 or equal
twenty one.
So this is the statement that we have here with the if key word and then in brackets the conditions.
So if this condition is met, then execute the code.
Otherwise, don't do it.
And in this case, it will not execute the code because the age is not greater than twenty one and it's
not equal twenty one, then we have functions and functions, enable us to separate code and to run
CodeBlocks when needed.
The cool thing is we can separate our code very easily with this and we can keep our code very clean.
And this helps us to re use code a lot.
So we don't have to type as much, which is great.
So, for example, we have again our main function, which is the entry point of our program and then
we call my function now what is my function?
Well, my function is this function called my function that we created at the bottom here, which is
just going to print a line which is going to say my function was called so nothing too fancy.
And don't worry if you don't understand everything here, I'm not going to go into details in this video.
It's really just to give you a very short overview of what you're going to learn in this chapter.
We will, of course, see what all of those brackets mean and how to name functions and how to call
function of what calling functions even means and so forth.
So this is really just a short example of a function.
Then we have collections and collections, enable us to store multiple elements in one place and iterate
through multiple elements with the help of control flows.
So if you want to store multiple values at one place, so to speak, so let's say you have a school
class with all of the pupils in there or students, and you want to store all of their names at one
place, then you would use a collection.
Then we have classes and allow us to create our own data types.
Keep the data members and methods together in one place.
And this allows us to write more readable and maintainable code, which again helps us to work better
in a team and to just keep working on our projects.
Because the bigger the project gets, the more complicated it will get, and the more important it is
that we keep things tidy and clean so that we still understand what we're doing.
And a very important aspect of that is to use classes, and that's really the major idea of object oriented
programming so that everything is a class to a certain degree, and we're going to see what that means
in the future, because this is a very advanced concept, so to speak.
So of course, it's still the basics, but it's rather advanced in comparison to the other stuff.
So I really only want to dig deeper into classes once you understood all of the other things that we
talked about in this video.
So classes are going to be the ending portion of this chapter.
So I hope this gave you a little overview of what we're going to learn and we're going to dig deeper
into all of the topics now.
So let's go to the next video where we start with variables.