Java from Beginner to Expert | Arkadiusz Włodarczyk | Skillshare
Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
77 Lessons (10h 57m)
    • 1. Introduction

      4:31
    • 2. What is Java?

      12:40
    • 3. 5 reasons to learn Java

      2:46
    • 4. Who am I

      1:31
    • 5. Downloading and installing IDE and JDK 13

      7:31
    • 6. Creating your first project

      4:28
    • 7. Comments

      4:28
    • 8. Basics

      7:09
    • 9. Shortcuts

      8:58
    • 10. Variables

      14:11
    • 11. Naming convetions

      6:07
    • 12. Casting

      7:13
    • 13. Arithmetic operators

      11:30
    • 14. Relational Operators

      6:44
    • 15. Logical Operators

      10:08
    • 16. Bitwise Operators

      17:59
    • 17. Conditional Statements

      5:56
    • 18. Curly Bracers

      3:40
    • 19. Switch

      5:43
    • 20. Conditional Expression

      3:30
    • 21. Arrays

      10:09
    • 22. Multidimensional Arrays

      4:53
    • 23. Loops

      8:50
    • 24. Loop for

      3:41
    • 25. Enhanced for loop

      3:56
    • 26. Loop in loop

      7:56
    • 27. Break and continue

      6:54
    • 28. Summing many values

      3:21
    • 29. Object Oriented Programming Overview

      14:12
    • 30. Constructors

      8:01
    • 31. this keyword

      3:03
    • 32. Methods

      14:33
    • 33. Overloading methods

      2:53
    • 34. Static keyword

      10:38
    • 35. Packages

      12:06
    • 36. Encapsulation

      11:54
    • 37. References

      8:35
    • 38. References passing

      5:58
    • 39. Comparing Strings

      4:06
    • 40. Bottle

      9:32
    • 41. Inheritance

      15:24
    • 42. Polymorphism

      11:55
    • 43. Protected modificator

      4:55
    • 44. Abstract classes and methods

      6:14
    • 45. Instanceof

      13:54
    • 46. Downcasting

      3:55
    • 47. Object class - equals

      11:34
    • 48. toString

      2:53
    • 49. Final keyword

      6:02
    • 50. What are interfaces?

      12:09
    • 51. sorting using interfaces

      12:35
    • 52. Nested class

      11:03
    • 53. nested practical

      13:07
    • 54. anonymous classes

      8:17
    • 55. Aggregation

      5:44
    • 56. exceptions

      17:51
    • 57. lambda

      13:32
    • 58. documentation

      13:52
    • 59. Default methods

      5:34
    • 60. What after this course

      3:02
    • 61. BONUS: generic methods

      9:47
    • 62. BONUS: Generic types

      16:03
    • 63. BONUS: wild cards

      8:03
    • 64. BONUS BASICS OF ANDROID: Downloading and installing Android Studio

      6:21
    • 65. Creating your first Android Studio project

      13:48
    • 66. How to change theme in Android Studio?

      2:16
    • 67. What is SDK, How to update Android Studio

      9:00
    • 68. AVD - emulating virtual device

      17:09
    • 69. Moving freely in Android Studio

      14:25
    • 70. What is XML and how it is related to Android apps

      11:04
    • 71. Activity and Views

      11:04
    • 72. Listeners - handling events

      11:06
    • 73. Faster button event handling

      7:09
    • 74. Layouts

      6:45
    • 75. Layout Basics - Linear Layouts

      6:13
    • 76. Linear Layout exercise

      6:13
    • 77. layout_weight - dividing your layout proportionally

      5:36
130 students are watching this class

About This Class

This Java course is designed for people who don't have any knowledge about programming. It doesn't matter if you have never written any programs or you have no idea about programming... After my course, all this will change. You will bust the myth that programming is a difficult thing only for the few!

Java is one of the most in demand & highest paying programming language.

Java's slogan is: "Write once, work everywhere."

You can use Java to create Android applications, desktop applications, games and much more.

One of the most popular games called Minecraft was created using Java.

After this course you will be able to use the advanced components of Java language.

Java is the base language for developing Android apps. You have to learn Java for Android development.

Save your precious time by buying this course. You will learn how to program in a fast and easy way!

The total length of the course is over 9 hours! You will learn theory and also gain lots of practice. During the course we will write many programs in Java.

If you have any questions regarding the topics covered in this Java course after watching videos please feel free to ask. I'm always happy to help.

Transcripts

1. Introduction: Hello. If you are asking yourself each time when you learn something new, why it really exists? Like, for example, why doing classes? I do. We need loops. Why they're constructed like that and so on. And so then you're in the right place because I will explain you everything. The easiest possible way from scratch. I believe that everyone has the ability to develop software. If they are a properly and it's including you, I'm going to give you the context of itching concept. I tease you, and after my cars you would finally understand everything. Did you go? I would like to present your video curse Java that does get over 60 lessons and it's overnight hours of content and it's also very well organizing to 30 sections. Head with quizzes, exercises and you might be asking now. Well, you wouldn't know after these girls what you will know semantic of job, which means meaning off words in Java. This is very important part because if you have sold basics, it will allow you to create whatever you want. You will be fluent in Java language after discovers, okay, and this is the most important part for every programmer. If you want to create your own applications in future, you understand things like the rebels operators. Conditional statements mattered. Zarate subject. Look, I will go through, For example, new features like Lambda Expressions from Java. Eight arrow handed exceptions. And you will I know lots of things about object oriented programming. And it's not like giving on annoyed because I am no reading the good to confrontation. I will give you Heene's. I would tell you why something exists. Why do we need inheritance? Why do we need interfaces? How do we use them? When should we use them and other things like that? Okay, so this is not just well next cars with somebody's reading. Take the commendation. No, I am going to give you kings. I'm going to tell you when and why you should use something. Why? Something is important for you. Okay, so this is very different course, And you might be asking yourself why should you choose my cards? Right? Here are some things that you can read about, but I would tell you also that I have enormous experience in teaching other people and I do it as you have probable rather not this a bit different way. I always explain everything from start catch, and I do not omit anything. If you do not believe me, then please go ahead and watch free preview videos. I even exist towards free videos before buying anything. I'm sure that you will be satisfied with my cars after completing you. And, well, it's really, really cheap. Comparing toward you can achieve after discovers after discussing, we have knowledge. And what is the most important ability to read Java language? You know how to read Java libraries. You can create whatever you want. You have any questions, Please feel free to ask. You can send me a message, and I will respond as fast as possible. You can ask me about programming but taking my place that I am not doing homework. But I would be happy to give you Heene's, and you might be asking yourself what you should know before this girl's well, this empty patch is suggesting that you do not need to know anything, so these can be your first language. It doesn't matter. It's for beginners. But also, if you have a program, something in Java doesn't mean that it won't be useful because I'm showing things that are rarely seen in, you know, places on the Internet. Because I'm giving you kids. I'm telling you why something really is important. If you know if you are creating your programs and you don't know exactly what to do next and you're trying to copy called from Someplace, then it's wrong. I you should create your coat on your almost time when it So it should be easy for you. And that's what I'm trying to achieve in discovers. Okay? And you are and be asking also yourself. Who is that? This all tore disc person? Well, my name is our cattle grid Atrix. As you can see, I have wars of experience in the matter. I'm also author of many video courses I love. I really laugh, teaching other people okay, there are many. Collins confined them them on my other courses on the Internet. This is almost impossible to not be satisfied with this current. If you have any questions, just ask me. That's only good lesson and have a good day 2. What is Java?: Hello, my friend. Today I will tell you what this Java will this programming language. What did you have a veto on matching what is a compiler and many other things like that? Okay, these are basis. And these lesson is very, very important in orderto understand anything in, well, any language. Not only Java. You want to understand programming, you have to watch this lesson. Okay? After these lessons, everything is gonna become clear. Okay, So what is Java? Java is a programming language that we use to talk with our computer somehow. Right? Well, you see, our computer is talking in a bit different language than we are talking, right? I'm talking the English language right now and you understand pretty well, right? But our computer likes things like that. 0101111001111111 Why? Because these are electric impulses, okay? And well, they jumped from zero to ones. And that's how computer is interpreting everything that you see right now. Okay. It interprets that sequences of 01 It will be very hard for us to write programs like that , right? 01010 and dude, me mean, I show me the pixel in the color like that. And, for example, I don't show the bottom creek on batteries. I think that claim hedging by doing things like that, Ted will be horrible. That's why we have got something with this called programming languages that are that are, you know, having Centex that is, you know, easy to understand. For us, it is not you as easy as, for example, right now, English, right? But it's gonna be easy if when we learn the rules like we learned, for example, for English, right, home, another language And what we just gonna be ableto talk? So, for example, we can ride later. Something like anti Jer be. And it means, Hey, you know, I want to save in the random access memory. So in the ram and a place for the main teacher, So it means I want to save a number somewhere, right? I want to find a place like that, and this being would mean I want to reserve something for computer. Okay, It will be, you know, well, this thing would not mean anything, because it's also only understand for understand by us, right? It needs to be also changed. 2010101 And the process of changing days in tow. 0101 It's called compilation. Okay, So programming language is something that is understand that stood by us. And But it's, you know, that syntax dicks can be easily changed into zero and once, right? Okay, so this is a programming language. And why did I put so much effort to, you know, tell you what is a programming language? Because, you know, in Java, the process of compilation is a bit different. It's very hard to understand for people new to Java, and some people do not even understand. It's after your writing with programs in Java for many years. Okay, So what's going on here? You know, normally, let's, for example, see here programming language like C plus plus right when you write a coat. Okay. So imagine here. We have got some kind of code. So we have got something like that, right? And be other things like that, or, you know, something like that in Java. Whatever. We have some kind off coat and this coat is gonna be changed. by something What is called copulation, right, So we can write it. Computation. Right. So this think ah is gonna be changed into the zero and ones, right? 010101 What? This gold is called mashing code. It's gonna be executed. Everything is okay. There is a small problem in that C plus plus solution. Because, you know, there is windows. There is really no, there was marking touch Android and other things and other platforms like that. The problem about it is that when you make that compilation, right, So we changed disc out into the zero and ones it needs to know the processor that is gonna execute there. Instructions here written in that coat. Okay. And because of it, when we compile it on, for example, windows, it's gonna, you know, be able to run only on windows, so you have to later compile it. Also on, for example, Lennox. And the problem is also that only knows you can have libraries that are, you know, for example, on windows and visa versa. So you can have own windows libraries that are no the very womb Lee knows, and then you have to write code many times. Wow, Law, this is horrible, right? If you want to support many platforms, the cool thing about Java and that's what that's why it's one off the most in demand and high Spain programming language Is that the slogan of Java is right ones and work everywhere. Why and how did they manage it? What job bomb is doing some things like that when you have got a cold, right? So we have got a cold like that. We have got the process that is gonna change this coat right into something. What this called and bite goat here. Bite coat. So it is something like between death code that would have got here and that we have got here. 0101 right. Dead bite coat is not gonna be, you know, useful for us humans because, well, we cannot read it, but it is very nicely reading coat that is gonna be interpreted by something. What? This called Java Virtual machine. Okay. These the program These of an application that you can install these a platform that you can install on any computer on android Lanners. You can find it here. We can you know, type job you call machine download, and we're gonna downloaded later. We're gonna need started, like, for examples on an agitator. Other things like that. And this thing is gonna change bite goat into zero and wants okay. And that's cool, right? It's gonna change this thing into bite code that can be interpreted on and a platform. That's why it's so awesome. But you have to also remember that you have tow installed the Java virtual machine. So without the Jelavic tell machine, it's not gonna be, you know, you're not gonna be able to run it. All right? Okay. So that's why java is so cool. So let's remind ourselves we're gonna answer later something like that that's not being needs an editor that allows you to write a code in place like that. And this coat is looking like that. I probably cars drive application. We gonna talk like, what is the public? What's public meaning with this class and other things like that, Right. And we gonna click, play like here, and it's gonna, you know, come pie, this thing. Right. So this coat the programming language into something good is called a pipe coat, and then the bite coat is gonna be run by Java virtual machine, like in time, just in time because, well, you know, you might be like now a This must be very slow. And you are right. It is slower than the c++ solution. But, you know, you have to choose this or this you won't spit or you want to support all platforms. But it's not also very, very slow because, for example, when you have got a code that looks similar, right, you have been a big golden next to seem out in some places. Then it's gonna create in the bite coat a special, you know, instructions that is gonna make it simple, right? It's also not gonna compile all your code if some of the instructions are rarely used. If something is gonna be used very often, it's gonna even sometimes run faster than instead prospers, Okay, because it's gonna create special connections that are gonna make Ron things that that ran very, very often. So it really depends on situation. So Java, it's mostly slower. Sometimes it might be even faster than C plus plus, But the truth is that you shouldn't worry about it because our computers are faster and faster it day if you want Toe right applications Desktop applications are, for example, android applications. Things like that do not matter, right? If you have to use right drivers were speed really matters then C plus plus another longer Just are like C plus plus are very important, right? Okay. Remember that even games are written in Java, for example, popular games like Minecraft was creating in job. So you have to know that there is a process that is called a compilation here. Right? So the compilation is changing coat from one type of kowtow Another coat right in competition also you know checks If you do know you made some errors So if I do something like that that you can see and when I click play Hi, There are some errors, right? Onda Also it helps you de back your coat So you confined box the problems the heroes in your coat We talk about things like that also lighter We will, you know, installed the idea integrated development environments off the editor that has lots of useful tools and we'll talk about all these things. We also inside the Java runtime environment, which is which has got the Java Vittel machine inside it. We'll talk about all these things later in this lesson. You right now? No, Woody's programming language, right? The programming language is just some kind of set off rules that you have to follow in order to speak with somebody, right? The programming language is used to create programs. So instructions that are gonna be executed after changing it into the machine coat by our computers. So we are, you know, giving requesting computer what to do. It's like forcing team to do its commanding him. Hey, do something like, hey, go into the system and then out of it and then print a line like, for example, Hello, Ward. And when when I click play as you can see, we have got here Hello water We'll talk about you know why? He reasoned, told why here is a public how these rules work with each other in next lessons. Remember that you have you have an IQ questions Just ask me. I really love helping other people. That's only good lesson. Thank you very much. 3. 5 reasons to learn Java: Hello, my friend. Today I will tell you five the most important reasons why you should learn Java. In my humble opinion, the most important fact is that the Java is the most in the month and highest paying programming language. Why do I think so? Because there are indexes like, for example, Tai O B programming community index. And as you can see in this, an indicator off the popularity off programming languages. And as you can see, this index is calculated using the global being a whole vic wicked bad. They are Amazon and other very popular services. And as you can see, Java is the most popular language. Okay, so it's worth tolerant because it's gonna be easy to get the job. As you can see, we can take change, check other websites like, for example, indeed that girl and as you can see, Java is also very high here. Okay, so why is also worth to learn Java? Because it is gonna work everywhere on every platform. When you write a program in Windows, you can run the same program own for example, Lennox. Okay, so it's very cool, think and there is lots off resources on the Internet. Okay. As you can see, there are very cool resources with a full documentation off each. Classes will talk about class or classes later. It is very, very cool because, well, java is an old language, right? So you can find lots of useful information in the Internet. People will know how to help you, right? If you have any problems. And, well, android under it uses Java to create applications. Right on Drew. It is the most popular on the mobile devices, which means lots off jobs for Java programmers. And it also means lots of cash. And the last reason is that Java, I think it's easier to learn than other languages. Like, for example, C or C plus Plus, Why? Because, well, you do not need to worry about things like pointers. All things like that are taken care, but by Java. Okay, you don't need to worry about things like that which are just hard to understand, at least for beginners. And, well, you know, I'm gonna t do the java, so I'm sure that you're gonna learn pretty easy because I have got a special method for teaching other people. Remember, If you have any questions, feel free to us 4. Who am I: Hello, my friend. You might be wondering if it is worth to learn from me. Who is the person who's gonna teach you in these cars? Well, my name is our cathedral dodging, and I have got lots of experience in programming and Web development. As you can see, over 20 years stand in programming and 14 years time in developing websites, and I've also created lots of video courses. So I have got lots of experience in creating video courses, 27 in Poland and seven in English. I am teacher off thousands off satisfied customers. There are lots off sample comments about my courses, and all off them are positive. There is no bad review off my courses because I always try to explain everything from the bottom of my heart. I love teaching other people. Really. If you have ended to tell any questions regarding cover topics, please just ask me. I really love helping other people. I will help you because well, that's what I shall do, right? If I do something wrong way. If you know I teach Abed way some some something the bed way, the way that you will not understand it means that it is only my fold, right? It is my fault. Did I told you it the bed way? I have to do it a bit different way in order to make you understanding. Okay, So if you have any questions, feel free to ask. If you do not like my course, you can take a full refund after 30 days time. That's only that lesson. Thank you very much. 5. Downloading and installing IDE and JDK 13: however, bother in the people's lesson you learned Will Java is. You know now that it is a programming language, it's time to start using this language, right. But to do so, you need to write down the code in some kind of plates. So you need something. Would is cold and editor. It would be great if that editor would tell you what you did do wrong in your code. It would call her former the code to make it easier to read, to take her off, compiling your coat. It would do stuff that you would normally have to do manually, right? So as you can see, this editor has good lots off tools and together they create environment for developing programs. And that's what we need to download something would. It's called I the team, which stands for integrated development environment. I think Nat Beans is one off the coolest free editors. He as you can use it for free. You can use a different ideas like, for example, intelligent. They the community version is free. Cleaves with us to the A coat. It doesn't matter to be honest, which Editori you go now use in this cause you configure, discuss using any I D. You want. The editor should mainly sit you as a future programmer. So it's good idea to play with different ideas and find the one that will suit you the most . Okay, so let's Donald Net beans, Let's go here and click on download. And as you can see, the newest version is here. So we're gonna click download and here we gonna click on Windows version. You have Lena's quick ear, you have marked the care. So I'm gonna click here and then here, and it's asking me if I want to Don't know it. So it's being downloaded right now. And if the interface off the page we are on right now has changed, don't worry. I've added the link to this installation as attachment to the resources off these cars. Okay, so can download it under these Lecter before we install it. This net beans when you don't want something goddess called J D. K. As you can see, I have already downloaded it at this. I cried. And, uh, why is that? So what is J. D King? Well, let's type Jay Dickey don't. And when we go here you couldn't see here is Java platform. Dre decay. 13th is a version when and go here. Ah, even notice that we have here something, Jay. The Key Java Development kit Standard edition. And this is a kid, as the name suggests. So it's consists off compiler Javito machine libraries that are essential for you to be able to program in net beans, for example. Right, Without it, you won't be ableto even insel net. So you need to download. It is crucial thing to do, and in order to do it, you just access license agreement here and click on, for example, here because we want Windows version. But we won't use the official version off Java Development Kids. Why is that so? Because, as you can see here, is reading something like that. The newly licensed permit Silton uses, such as personal use and development use at no cost. But other uses authorized under prior our or Ike O. J D. Carr licenses maybe no longer available, which means that you need toe well, if you are getting money from writing programs, you need toe biden the subscription costs, which you can read more about here. Fortunately, for us. There is an open version that you can download here. Okay. However, I highly recommend downloading from it from this website because installers from these websites are easier to follow. Easier to use. You won't need to bother using this open side here. Okay? I highly recommend using the Adam Open, J D K. And he We can choose the version we're gonna choose, then you What's one? Don't worry. There is version 14 because they have some. They have speeded up the version so much lately that even programmers do not care about, to be honest said that they change versions so fast. Right now, people are really using diversion aid right now, But they create new versions because, well, somebody to pay for it. Right. And you are wondering, probably now, what's the difference between the free version and the paid one? Well, there are some sometimes security breaches right in programming, and they will be fixed faster in this addition. Okay, in the one that is official here, they're gonna be fixed. Oh, but a bit later, right? So you have a big company and probably want to focus on this. Maybe we are just learning give You are not doing any big programs. Definitely. Just don't even bother to use the official addition. Okay, because other things are the same. So when you click here on other platforms you were not is that we can choose also Line oaks . We can choose the mark. We cannot choose windows, so let down on it. Here we're gonna choose J decay, which includes already Ah, Java runtime environment, which includes Java virtual machine. Don't worry, if you don't want to remember by hartal these deprivations that I presented here, the most important for you right now is to just install weight and focus on programming. Okay, so we go not insult. J d k saved a fine. And that's way the second. Okay, let's open it on and says that it is executable file. Are you sure that you want to open years? We are sure. Okay. Ah, let's run it. Let's now click next and let off course. Read the agreement. 30 ik next here. Remember to choose deception and deception than next install and just wait a second. It's time to go like finish and now we need to installed in advance. So that's do it. The process is easy. Off course. Reach agreement. Except next. And here it found the J dedicated. We have just installed Eve. You don't have anything here. It means that J. D. K. Wasn't installed properly. So? So I do instantly the game. Next you can check for Rob. It's good idea to check for updates. Install and this process will take a wine about free. Five means really depends on your computer. Okay, The installation completed successfully so we can just finish. And that's only lesson. In the next lecture, I will show you how to create your first project. Where do we pull? Put your coat. 6. Creating your first project: how long? Today I we show you how to create your first project in NAND beings. In order to do it, you creek on file, then new project. And then from thes categories, you can choose at template. So how Your starting coat should look like it's just gonna hell, Bill, you don't need to create, you know, basic fights each time again and again just does it for you. As you can see can program in html in the pay PHP. It's just up to unit beans issues also for other programming languages. But we gonna accuse Java with aunt. What is Aunt aunt is You know this small being I don't know. Just kidding On is a build script toe build, run and debug your project. OK, so there is a great of maven. There are differences. To be honest, it doesn't matter for you for now. What are the differences between these building tools? Just use Aunt stick with it. Don't worry about these names here, So focus on Java with and and we do not choose job application because we want to create job applications and then we click next. And here we tied the name off our products. So, for example, name off my project, right? And then I click finish. And that's how we've just created our first project. Dead is called Name off my protection. As you can see, I d, which is integrated development environment has got here Lords off tools that we need to learn about. For example, here on the left side, we have got something like a project manager where we can see folders we've defies that we are currently working on. We have got now on the 15 that has been automatically created with that ham play that we used. And this is the entrance to our program. As you can see, it says to us to do called application logic. You're so when we right here something like, for example, this off course. Don't worry. What is that? Because we go now, explain it better in the future while I'm going to explain. But in future and when you click play button, as you can see, we have just compact our program. We have build it, and here we have a result. That's cool, right? We didn't need to do anything manually because everything was done But by this integrated development environment here there are there is lots off others starve like, for example, his story you can see also I did today something like these are so I changed using to diesel. As you can see, it can help you follow it. What you did in there current day over the last day. Durham Any useful stuff in idea? We will focus on a few of them in the future. Lectures step by step. So don't work for now and not is that idea is also polarizing the key words like for example, class public. Of course, we're gonna talk about things like that in future. Would they mean? But no. Is that because off it your cold looks better, right? You can, you know instantly is also he was because all so here is a public thing, right? Also he's here is by maintain anything you can instantly see. We see where is what? Because it's colorizing your coat does not all not beans can help you also sport errors like, for example, as you move ask you as you can see when we move here, our course or close inter first in unexpected Also, we expect kids, something good is called class. Okay, Now everything works fine. So when you make errors, you gonna be informed about Let's remove the column from here. Expected. Okay, so let's Audi bag in. Our program works fine. Now, this is pretty cool, right? Because, well, people tend to make me steaks, and you go now, make thousands of them, and this is pretty normal, especially of your beginner. But even if you're advanced, you're gonna make me stakes while you are programming. This is normal. So do not worry about it. If you feel like you are outcast or something like that. No, this is pretty normal begging, so don't worry about it. Okay? There's only good lesson. Thank you very much. 7. Comments: Hello Today I would tell you what are comments and why it's worth to use them. So I have created a new project that I called Commons application. And as you can see, I have got here some coat. And between this coat, I have got Colman's like that. So everything that is colored in gray by the editor is a comment and it means that it is not gonna be interpreted by compiler. Okay, so this is the place where you can give at the shoma information about your program because normally, if you did something like that, for example, this is a public law us A secrecy. The compiler is trying to interpret this thing all these tax here. But if you do it that way, we just one line comment. You can do it pretty easy, right? You can comment your coat. So why would you want to come and your coat? Why spend your time doing it? Well, because we are people and people forgets thinks like right, we are just human. So we are not perfect. And because of it, after you ride your programs and when you come back to your programs after even one month no, one year to year or three years, even after one month when you come back to your program, you know, gonna almost remember anything about it, Really? So that's why people are commenting things. And that's not the only reason. The second reason is that you can. We work in team, right? You can work work with many people at once, and they will not understand your coat instantly. But with comments, it's gonna speed up the development process of your program off your perfect application. Big application, right? That's why it is really very, very important to commandeer coat. So there are two types of Commons one line comment, which allows you to comment here, as you can see. But when you could enter you cannot it see animal common, right? It's not gonna on comment this here, and the more you want to have multi line comment well, you can do, of course, something like that. But, you know, we do take lots of time if you want. If you wanted, then delete something right from middle, for example, like that black you can use something will discover multi line comment. You just type slash than the mastery sign sign. And then you can type comment right on this. Considers editor. Automatic carry automatically changed on that Well inserted here. Ah, this science. Right. So now you can have multi line comment like that. You have probably noticed that that generated comments that are here have good additional asterisk. Well, you don't need them here. They are just here, so it looks better. But there is a small difference between this and this. If you start it come in like that, it's gonna be later used for the Java documentation. Okay, there is a program called Java Doc. We just generate a documentation, so there's a pretty big difference here. We gonna have a special lesson where I'm gonna teach you how to create properly comments. But, you know, we cannot do it right now because we don't know what it's class with. Our arguments have to send them whether functions other things like that, we gonna I'm gonna show you everything like that in future lessons. For now, you just need to remember that you should create your habit, a habit to come and your coat know everything but things that are just a bit harder. Okay. It's good idea. Did comment your coat Because it's gonna save you lots of time, not only for you, but also for your future team. Okay, there's only good lesson. Thank you very much. 8. Basics: Hello Today we'll talk about basics in programming in Java. Language. Well, the first thing I would like to tell you is that when we remove Colman's we have got here something will discord y spaces. White bases are enters Taba. Laters spaces. And, well, they're not interpreted. As you can see, I can play it. Well, I can have everything in one line. Look what we can do it even like that bomb bomb on bomb. Everything is in one line, right? It doesn't matter for the compiler, it is a computer, right? It is just gonna interpret everything like it's, you know, formatted well, but you should form of everything pretty well, and you should do it the way that I will do it in the future lessons. Okay, If you follow how I format things, your code will be read able not only for you, but for other people. And this is very important to I understand, right? So, for example, instead of writing a plus B, you can write a space blast space be It's gonna be easier to read. And well, I'm talking about these wide spaces because well, you need to know that what we can write everything in one line because off things like, for example, semi colons, You have to remember that after every instruction you have toe ended with the semi colon, every instruction is a common toe. Your computer, What is a common? Well, a coma instruction is just forcing your computer to do something. So when you write something like that, you say, Hey, I want to include a package called Basics We just here. If we had more fights here, it would mean that you could use all informations from other fights like that inside here. Right? So that's why you have got the package named Basics here and well, right now you know what is package right? You can include other packages from other people on that were created by other people on Did you can use then thinks from there. And what are these things from there where they are classes here is a class created automatically by our net means, right? This is the main class. It is public with this public weight. Well, it doesn't matter. It's just a modification. Er you just need to know that for now, it ah, the main class has to be public on the main cause. We were just You know, that class that has good the name magnify. Okay. And, well, what is a classy might be Wondering. Also, a class is just an container, a container for things like properties which are gonna describe something like, for example, a window. We have got the window, he right, And these window has good work with Hi. And you can do things with that life. For example, close it and you can, for example, maximize it. Neymar's it, right? You can do thinks with the window and things like that are gonna be described inside the club so we could create a class. We work a window and inside of it would have properties like waves like high. And we could create a function which is something like that that could allow you to close it open. And as you can see, here is a matter which is oclock, which is a function, really. So this is similar name, right method function, and it's called main. And the reason this function is here that it has toe execute all instructions that are inside of it. After invoking that main function is very special because it's gonna automatically be executed after creaking here place. So we would create an instruction here. So, for example, system, which is a class somewhere. And when you get to something with this out, which means that we want to get out something from the system, right? And we want to print something. For example, attacks life example, sample text. This thing after clicking play is gonna be printed here, as you can see, So these function is gonna execute other functions, other instructions. As you can see, we have a tour, a semi colon, because this is an instruction, right? You have also probably noticed that here we have a good carol Abrasives, Kerry braces say where? Well, you have to say where there class is starting. Right? So the basic class start from here and ants here, right? You don't use semi column for it because, well, you have semi column here. Still, the compiler wouldn't know. Well, I decepticon is for for for what? For these crowds or maybe something else. Right. So that's why we have good care of the braces. And method also needs to know where it has to start and where it has to end. So here we invoked. So it means that we what we use somebody called that this start inside the print function and this print function is, as you can see, after kicking place showing something here, and we're going to create our own functions in food future lessons, you're gonna learn lots of functions from libraries that are gonna help you, for example, create a window like that one or, you know, calculates something. Cup. So this is the reason off creating functions and that's how you use them. These the basic functions that we're gonna use in the future Lesson. Keep in mind that this is a very, very fast introduction, and you don't need to worry if you don't understand that. Well, what is that strength in? What is that? Think here like that. What is vote with this study? Good is public. Why you didn't tell me about this? Doesn't matter. For now, you just need to know that this cult is gonna be invoked first. Okay? And later we go. Not. I'm gonna introduce to you something like vory bulls than alright, then We're gonna go to the functions, matters and other things like that. Why do we have modifications like that? That what are exactly classes? How to create them? How toe, you know, connect it. Medical, many classes to each other, other things like that, right? For now, we want to know that Main Functions is a special function that is gonna be invoked as a first function. And it's gonna invoke all possible instructions between discovery braces and this curly brace. Okay? And we gonna learn the syntax of Java in future lessons. That's forward for now. Thank you very much. 9. Shortcuts: Hello. Welcome In their balance section, where I will show the most useful short cover. It's gonna save you lots off time When you gonna develop programs, your own programs. Why? Because you know, using your mouth is just a bit slow when you have to say things off, for example, five. And then do they go to the safe here? It just takes someone you to copy something. So when you do things like that, mouse is just always slower. And you have to remember that you gonna spend lots off time writing code as a programmer. Which means that E knowing all these short cuts is gonna save you time each day. And when you multiply it by the days that you're gonna program is gonna save you lots off days off your very precious life. Okay, so let's start from this first shortcut control plus s from, as is from safe. And it's just saving the fight you have. You will notice that when I change anything in the program that you have got here a bolt bold it fine. And I hope I'm automatically saving, always using the counter process. Why? Because well, when, for example, I would lose the power, right? I would lose all my work. Right? Some editors. Can you get back to the place where you have lost your power? But some doesn't. And this is the universal Ah, shortcut. You can using an editor. So it's very important to know the next one is used for toe copy things. Well, you know, it's slow to company things like that. Balm on Go. Oh, here is a copy and then enter here and paste. It takes lots of time. You can just use control Potsie than control plus V And this you consume can copy. And as you can see now, when I didn't want to have a change like that, I can go back. Using the Contra Palazzi days is very cool shortcut because it allows you to go back when you did something to your Cody. Didn't want to do right. It's very, very useful. These did well and but sometimes you might think it a bit too many times and you can use the country plus why it will redo the action. Okay, so you can go back to the place where you started going back and whether you have. You can also cut something so you can you know you don't You can copy, but in the same time, cab, the thing that you want to copy from the place of for example, remove it from here and ties it here. Right? Okay, let's go back to that, uh, origin or fight. And let's now find out what is the counterpart? F shock. When I use the counterparts F as you can see now, I can search for things inside our products so I can fight, for example, main function. I confined. For example, Where is the public key world? Where is the package or other things like that? I can instantly find things on. It. Really has you a lot. Almost. An editor has good. Something like that, even in the Web. Brother, when you're browsing for something, it's very important because you're gonna browse for two to learn about libraries for Java, for example, and you want to find something specific about Java. You can just use the contra plus F in the Web browser, and you can find it faster. Okay, so it's very useful Shortcut control, plus a which sends for all, and you can just select all things from your from your well program. Why? Something like that is needed. For example, you can just do something like that. Now they control plus C and you can paste the code from here to, for example, a place where you going? Toe. Ask somebody. Why doesn't war, right? You can come from Passaic Controversy counter plus food V somewhere else. So it's very useful control plus back space. Sometimes it's gonna happen that you want toe deal it something like, for example, award to write. The truth is that you want to, for example, remove a variable but we'll talk about a very poor state. And if the name of a rebel is long Oh, so you need to do something like actually basically sleep exit right. But you can also do things like counterpart class backspace And as you can see now you delete full work at once. So it's also cool and this thing is also very useful. It is top and chief, plus stop thes one. You probably know, but this +10 this is very useful. And many people doesn't know that you want. You can go back with your indent, right? Would. I mean, let's create a variable in. And that's a sign here for we'll talk about later, things like that. But you know, physical and we are checking if a is equal to four. If yes, then I want to pray into the output ball or something like that. And well, as you can see, we have go to an Indian and sometimes you might have a problem. So, for example, you you have a cold like that. Oh, it's not looking good, right? You can go back using the shift, plus stop it. You can see you can go back using something like that. And the cool thing is also that you can use the top toe move manner as you can see things at once, and you can go back also. And well, waters, you have got here also, something called is called and and home on your keyboard. When you're for example here and you creek home, we are at the beginning of the line when you and your at the end of the night and when you I want to, for example, copy something like that, you can do something like shift plus home and, as you can see now have got selected line. And now we can use the counter policy and now concretely and and then enter. And as you can see now, you can copy it pretty easy. Was more You can use the shift and the arrow keys to select more than one online. You can also use the left and right arrow key to select specific. You know, as you can see, um, character and then you can copy writes a country plus seconds plus V on bom bom bom bom bom bom bom. As you can see, it really improves the speed off cop eyeing things on your in your prose. Of course, I'm doing things like that very far. Right now. It might be new to new things to you, so just train. You just need to train. And finally, you're gonna know all these shortcuts pretty well. You have got all them all described. You can print them so you know, just drink and you have got also something Go Discuss control plus home, which allows you to jump from the place where you have got your cars are okay so you can jump from here to the home, off your program and to the end. It's very useful because it can. Sometimes you want to go to the top of the off the program, and it's also useful because you can use the shift plus and a ship council plus. And and, as you can see now you are selecting with using something like that, right contra plus shiftless and allows you to select from the place from the course. Of course, a place and home life it There is also very important shortcut for these editor. When you take, for example, stuff like system, then you click a dot that you can see you have got you a man manikins, right, But sometimes you can lose them. You can do something like that, and you want to somehow get them back. You don't need to delete the dot in order to see the game. You can also do something contra plus space, as you can see. Then you get get Sheen's like that, so it's very useful to get him. You can also use the control plus space to, for example, create a coat like, for example, I look for as you can see, then you can just change things here. And you have just created a pretty because this is called a snippet drive. You can create a sniper's like that, using the control plus space. And I want to check if something is true or not. So this is pretty useful. A Z you can see wide Look, another things like that. Um Okay, so that's going to listen. Just trained it. Thank you very much. 10. Variables: Hello Today I will tell you whether we're Abel's. What is a type of a Rabel? What type off variables you can create so ever able is a container that you can use to store information data like, for example, numbers, characters, other things like that. So very booth are looking like that, right? A container that you can name and you can put something inside and well, the true vis that it looks more like that you have got a ram, which is random access memory. Yes, that's why you need rum. You want to reserve something from your random access memory, right? And when you do it, you can starter, for example, numbers, characters or floating numbers. So numbers like that and have to do it. How to give an instruction to your computer to reserve something from the random access memory. In order to do it, you type something like that in the main mattered and a for example. So I have just reserved in the random access and memory at place for numbers for in teachers. It stands for integer right, which is a number, and now I can stole their a number. How to a sign there a number. How to change the value there, Right? In order to do it, we talked that equal sign and then we say what you want to assign there. So, for example, 10. So right now we reserved in our random access memory because he's an integer integer is saving 30 free bits, which is four bites off your memory. So yeah, it would take for more bites. Your program will take former bite when you click play and well, you assigned her 10 right? This assigning is called initialization when you assign a volume two variable the first time so you can later off course change these value. Or of course, you can also send you to the airport using their for example system out print line. This shortcut life just used is when you typed the sea out on you kicked up, as you can see, then you don't need to type all this. Think again, because off the net beans, I d. So I just sent 10 on the outward. As you can see, it's working fine. And of course, you can change these value at the time so you can change it to for example. 50 on as you can see now it's 50. So that's how you change a value. Well, variables are called like that because they are able toe very, which means they can They are able to change right on. And we have just changed the value off. They're very able like here, which can start off course only in teachers, which are numbers. So, um, we have to remember to be careful to not set something like that, right, Because this is called string, which is sequins off characters. You kind of start characters inside different container that has got the wrong type. OK, so we need to learn about all possible types that we can use. So we wanted to start here something like, for example, string. We need to type string. Then, As you can see, we can easily start something like that. So, for example, my name, right? And of course, Aziz, you have provided noticed. I can't assigned to a string a number, right? You can change the value too, the different type volume. So, when I played as you can see, here is my name. You can of course, create and well, you should name in the big betters off example name and now my surname. Right on Now we can something like named plus starring Plus is used to connect to three things. And as you can see now it's our Kardashian for Dr. If you want to add the space, you're just gonna do something like that, right? Our country is for Dutch. It's just that it Ah, some space here, right? Using this quote signs. So that's a string we need to something in common that's created live as described Would we have just learned? So there are integer types like the end and it's 30 feet bides Let's go. Paid here from here and well, you can start there from minus two to the power off. 10 to 1 to to to the power of 31 minus one. Well, we could go into these a bit deeper. You just need to know that you can start values from that. Ryan arranged to another run. Tried. So when you do something like end A, you can on the same here or something like that, because they say, you know, this number is just two large. Okay? It's too big. You cannot do it. But hey, what if I wanted to assign here something? Because, you know, sometimes you want to do some scientific stuff. Then you gotta use for example, long, Long is 64 bits and you can start their numbers from minus two to 63 to the power of 60 feet too. Two to the power off, 63 minus one. And when you do stuff like that, as you can see now, it doesn't work still, but is because by default and the number looking like that is in teacher, if you want to change it to the long you need toe, do something like that. You need to type. But the n l let's do it with the big letter so we can see right and no when the get it to the output. As you can see, it's working. We did it that way. It's not gonna work if we need it. For example, that way it's also not gonna work. OK, so we need to add this l at the end to say that you know what you are doing. You want the big numbers here, okay. And well, what in the other in teacher types that we have. We have got some short like, for example, by which is a bit bite is really a bit so it's nothing surprising. Thing is the smallest amount off information you can start one beedies smallest information can store in your computer Which 01 right and, ah, the the ranch from is from minus 128 to 127. So you gonna use the bite when you don't want to start big numbers like that, you want to start just very small numbers. And you I don't want to used to march spacing your memory right. You're going to save your memory. You can also use the short integer with its 16 bits and you can start their from 32,078 miners 7 32,768 to 33,767. So something like that right on you can start the just beat bigger number between this thing. Okay, so these are in teacher types and now character types. You can use the character time to store a character. So example was carried the character and let's assign here a character like I and let's get it did output. And as you can see, we can see character. You can start on the one character. We're gonna do something like that, right? We want to do something like that. You have to use the string which can start sequence of characters and look at the difference Here. Here we have double quote right here. We have an apple stuff, but its single call. And well, if you want to create a stringing to use that one, you want to create a character single Carter, you have to use them apples through a single quote. Right? That's very important to know. So off course there is a string which can start many characters. All right, so the one that we have learned here like that there are two more types jaar cult floating numbers, which allows you to store numbers with a fraction. So, like, for example, that right, In order to do it, we should use the type that this called float double, so float. It's single procedure, which means you can lose precision here. Onda double these double precision, which means that it's better to use the princess this room is that right? Now, almost nobody is using the floor because it's mine. Give you more headaches. Good things. Okay, this is a good 30 fee. Book bits is 64 bits on these one can store 1.4 multiplied by 10 to the power of minus 44 5 So the fraction is very small. You can have fortified zeros right after the dot and to three point for multiplied by 10 to the power off 100 and 20 is 38. So it's very big number. And here is even bigger because you can start your 4.9 to the power off what minus 320 free . So it's very big on here, freak on there and that. But as I said, area to know these fault, Unless you want to server small number and you don't want to almost when the operation. Okay. And you really, really want to save the random access, more memory, which we have. Tom's off off the right hand right now. So big that we shouldn't most time care about something like that when you But if you do not need to do any preparation, need to store a number that is, You know, you don't that doesn't have many things after the dot. It's then. Well, yeah, you can use the float, but there is a small problem when you carry the float, for example. Number. Right? And you're saying here something like that, you notice that hey, he was something wrong. Have toe as it to float for the hell was going on. Um, when we do something like that, it's concede program is not working so flawed is not working at all. When we create a double its working for I'm fine, right? But double Well, any number that has good a fraction has good that is automatically adding here something like D D right, Which stands for double. Okay, now it working finest consisted for float. You need to trust us here, and f Why? Because, you know, some people could make this mistake to create float number, not knowing that it's single precision, and it can create for him problems that would be very hard to solve. Okay, so that's why instead of flowed, it's better to use just double okay, unless you don't do an operation on these numbers, it's also good to know that when you are creating vory bulls, you can create man at once. We can create something like end on. Do you can do something like C d E f g. Right further the problems. It's good idea toe at your spaces, so it looks a bit better. And, of course, you can initialize one off them for self, for example, like that. And it's gonna work fine. Off course. You cannot use the variable that is initialized, which means that it doesn't have have value. So you need toe to something like that. Okay, designing that lesson. Thank you very much. 11. Naming convetions: Hello. Today I will tell you about naming conventions for variables. I would tell you also what you should and void. So naming conventions means how you should name your variables. The first thing you should remember that you should net create a variable that should be said the script, which means that it should be like when you look at it, you know exactly instantly what it's gonna be useful. Okay, So when creating a were able and you call it a pet idea of course I use it in the last lesson. But it was just do fellow you how to create a variable. But you should avoid situations like that. Your were able should be said that script. So if you are creating a string that we will star names, you should call it name. Okay, It's gonna store starting. Call it Starling. So surname our cop. The second thing you need to know is that there size of letter or future terror matters. So if I want to change these name, I shouldn't type something like, for example, that because it is not gonna work. As you can see, it's not working because these vary but it is not the same as these words, right? These something like that. I'm just gonna create another variable, right? With just starting letter, which is big. And you should also remember that you shouldn't start name off variables with big letters Because these a convention variables should always start from the small case on. Then if you want toe, have you know something like name and signing, for example. Right? And you should be deadly. You should, for each word, try to have the upper case off letter. OK, so now it's you can instantly. Hey, it's name and a salmon instantly. Right? Oh, okay. Because if you call it a you don't know what this start here Exactly. You have to look at the value. Okay, Maybe these values very easy, but maybe these values sent from from the fire and you don't know exactly what it's gonna be right. So always try to name everything to be said the script and what you should know that you cannot create as the name over able as the label off. Vory bull, you cannot use keywords, which means that you cannot do something like that in public as you can see. It's just not working right. You cannot use things that are reserved. Why? Because you know, interpreter is just going well nine by time and line and is trying to compile it. How can Kinky complied when when he knows that started means something totally different, right? Uh, it's not gonna work. The second thing is that you shouldn't start creating a variable from the number, so you cannot do something like that that's going to see it's not working. You can have numbers inside. Like, for example, here here doesn't matter. But you cannot start from the number because, you know, then compiler things done that you're creating a number, not a very And the terrible thing is that you cannot do spaces so you can do something like that. Of course. Right, because, well, it's another work. There is a so one more convention that you should know when you're creating have a rabel that is constant, which means its final it's gonna be changed it like, for example, P number p. So, for example, in create being like that, I am gonna use, as you can see big letters, because it is not gonna ever train Friday is always free point for So when you're looking in your program, then you know which variables are constant final and which are which cannot be changed. And you can even say exactly Hey, I don't want these very will be changed and you type them final before it goes of it. When you do something like, for example, trying to change it, you can see you have a good an arrow. We have the final here because you can change pretty easy these without the final modification. So because just lentils with our motive IQ a tres they can modify how the variable is gonna working in program the final Leave it like that. And well, it's good idea that if you had more than one word in the final variable to do something like that, for example, number dash be okay. You're not because you're not gonna lose your hearing. For example, small case letter. You just we want to give that space there. You should used underscore because this is an read a book. This is readable pretty OK on. But that's that's how you should create variables. How you should name it. Remember self descriptive paraders are very important in order to make your coat clear and easy to maintain that telling the lesson. Thank you very much. 12. Casting: Hello Today. I will tell you what this casting casting It means changing a type of a Rabel into another type of a Rabel, and it is used in situation like I will show you soon. For example, when they create assistant outpouring line method and I do something like one divided by five, you probably think that he will have, as a result 0.2. But the result is zero. And when we do something like, for example, for Hey, it's closer to five. It should be one, right? No, it's easier. But well, if you don't five divided by five, then it's one. If you don't eight divided by five, it's one. If you do 11 it's too. Which means that the result off division off to in teachers is always an intention, right? We just take the fraction away and just throw it to being right. It's gonna be deleted. But, hey, I sometimes have situation like that, eh? Divided by being and I don't want as a result to hear. I want here 2.5 how to do it. Do I need to change the type of are able? No, you don't need to you can some times want situation like that, and then you cannot do it that way. You're gonna use casting If you want to cast a type of arrival into another type of a Rabel , you gonna type the parent is is than the type of Arabia we want to casto. Then the next parent is, is and the name of a rebel. You want to cast to another type. So right now you want to change the integer to double And if one off the variable iss double, it's enough todo the results So the result becomes, as you can see also double Okay, So if I did something like that see, divided by the it's gonna give us a za result off course 0.8 If I'd do see by being it's also gonna give us the as a result, the double. So that's how you use, you know, casting. But let's see eating other situations. So, for example, let's create a result unless it's something like that. A divided by B on double results too see divided by the and let's get it to the output. As you can see, the result is still of course, because five divided by two, it's 2.5. But the result is what integer Andi. Now imagine a situation you want to divide A by the way, you want to divide to different type of Arabe als. Well, you have probably noticed that we could do it that way right here it's gonna wear. But here's something is not working fine. Why? Because Well, he we just printed it out. But here in the line 11 we want to assign the result old into the ah variable called result . That type is end, right? We want to assign double into end and it's not possible. So you have to change the result into the integer. You have to say the compiler you want and you know what you are doing because you know here , as you can see, size incompatible types possible loss of conversion from double to end. So it means that hey, you can make make some problems here. I want to make sure that you are doing everything fine. So you have to use the casting right, but not to double but in teacher, because you want to change the day into their integer. So you have got the integer divided by integers of the result is in teacher and now everything works fine, Right, Because five divided by 15 0 upon free, free, free, free, free. But you gonna throw away the fraction That's how it should work because this is a, um, division off to in teachers. Okay. Ah, let's see what would happen if we did something like that See, divided by s So we want to divide toe maybe see divided by Oh yeah 12 Divided by five It's shoot. Give us the result. As you can see, 2.4, it's double because well, doubled by integer is double Okay, so you can assign double to double right? So everything works Fine. But if you want to see as a result here, for example, on Lian Teacher you could do just something like that. Hey, I won't hear a name teacher on this. You can see now we have got here too, right? We couldn't change it and the second to another time doing something like that. You also need to know that sometimes you can do things like that And as you can see, the result is wrong. So if you want to fast change the result to the right result, you need to change one of the type to the double right using the casting. But you can do it a bit faster. Way you can do just something like, for example, that 1.0 why it's gonna work is that because this is the two double type, the value off double unity is the point. But hey, you are so you're thinking like, right now in line eight, you're not using something like that. That's true. But in the background, the compiler is gonna change the integer into double here. Okay, It's because double has bigger precision and that's why it's gonna work, right? But as you can see, for example, if you do something like that, it's not gonna work because, you know, double cannot be stored inside an integer because double has good big gulp. Recisions can be a big number, and it has got lots of more buys and other things like that. You cannot do things like that. We've out exactly saying I want to change this into the indigent. I want to lose everything from you know, after the dot, right? You want to lose the fraction. That way it will be okay. So that is casting and the There was another thing. Another place. Where you gonna use it? It's gonna be used when we we cannot talk about polymorphous, but it's gonna be in the future lessons when gonna talk about object oriented programming for now, it should be enough for you. That something good lesson. Thank you very much. 13. Arithmetic operators: hello today. I would tell you what our operators and we'll talk about arithmetic operators. So operator is, as the name suggests, and operators of something that is operating on something in our situation, it's gonna operate on variable. So it's gonna do some actions on variables, and in this lesson, we'll learn about arithmetic operators. So, for example, plus miners mastery sign and the Baxter sign. As you can see, they are useful adding force, obstruction, multiplying and dividing. These are pretty easy one, so we'll focus on a bit harder one. Okay, so these only you just used by, you know, typing on the left side, one of arrive on the right side, done other wearable. And it's the same I give you didn't on math lessons. These are the basic operations. It's 100% that you know them. So let's focus on things like here when we have got the variable. So, for example, in A and I assigned to 552 years and we send it to the outward. As you can see, we have got five. What would happen if I wanted to increase the value inside that variable? A. By, for example, free what to do, where I need to do something like that. A assigned to a A plus free. So we are assigning here the value that was in a before So five. And now we're adding freeze of five plus three is eight. And because of it, as you can see, we have got at him. So in order to change the value without losing the last value, you have to just Assane the value that was there in the first place. You might be like about Hey, how does he know that here is five. The new value? Well, the instruction is gonna be always executed from the right to left. So first we're going to add five plus free, and then we assign the some of it to Hey, so as you can see, that's how you do it. But well, it takes a bit off space. And you know, every programming is programmer is a lazy person, but in the intelligent way so you can do Stipe something like that. As you can see, it's working also on Well, let's do this one. As you can see, we have got here eight. So we are plus five plus free is right. So these a short cut for doing something like that. Okay. Off course. You can also use it to do other things. Like, for example, let's remove. But let's subtract from this, for example to so we have free. As the result, you can see the result is free. You can, of course, multiply so we'll have five multiply biter. So it's stand five multiplied while divided by, for example, free. As you can see, it's one. Why? Because five divided by three is y 1.66666 And this is an integer Opara operation, right, Because there's an integer type. The result is also integer if we change it to double here off course, the result is having the fraction, right. Okay, so that's how use the shortcuts and use them because, well, these are very often used operations, so it's very useful toe know about them. You will surely meet something like that in your adventure when you're gonna program and well, you can also use something like incrimination and decriminalization. Implementation and dick lamentation allows you to fast at one or two the value to the original value or D cram in the original value by one. Okay, so for example, we could do something like that that a plus plus and as you can see, when we executed, we have got here now, six because five plus one equals six. Right and off course, You could also write something like that and it is the same. But I you know, it's shelter. So you're even more lady here. This is the most frequent operation when you are doing anything with looks that we'll talk about, for example, in next lessons. So these use very often so they even more decrease the amount off characters you have to type in order to achieve something like that, right? So way are just decreasing the amount of characters we need to type doing things like that . Of course, you can also use the discrimination. But there is also one more problem here, something like post implementation and pre incrimination. Post implementation means that you are gonna increment after sending it to the output and bring commendation means that you want to send it to the output first, and with that value over the increased well, let's show you an example here. When we do it that way, it doesn't matter because we're not sending into the output in the same time where it matters is, for example, here when I do it here a plus. Plus, As you can see, we have good five here. But if we did something like that, you will notice that we have got five here, but then seeks. Why? Because Well, it is a post implementation, which means that we have toe firstly what show on the output five and then increase it by one. So it will be the value will be increased by one. But you will be able to see it on Lee later. After after these well instruction here, right. If you want to change the behavior like that, you just need to take something like that. So as you can see now we have got your six. And here is also six. Um, of course, the D Crimen rotation also works the same. So as you can see like that, when you do it that way, you would notice that we have got five Firstly, because we are doing post documentation, which means that we want to first send it sent the value of our able to the output. And there is also something goddess called the moat operator. The Reminder off division Operator, this is one of the coolers operators because it gives you the remainder off the division. It gives you the fraction. Right? Um, what is what is rest off the division? Let's see. For example, let's do something like five mult. One more five. What do you happen? What will be the result of this? As you can see, it's one. Why? Because one more five is Jaws one ah, divided by five. So it's like something like, we just take this place here, right? When we do something like that, you would notice that you have got to do we just take the fraction right? But what happens when we get here? Six. As you can see, we're good. Still one. Why? Because six divided by five equals one and one one divided by five. Right, So we are taking just these place from here on. Well, if we do something like that, it will give us, as a result zero. Why it zero Because five divided by five is 1.0. There is nothing after the dot right? So, uh, you might be like ahead by a body Say that it's very cool White. So cool, Because imagine a situation when you want to do something after each free rounds. So, for example, if somebody click on bottom three times, I want to show something special. If he doesn't, I don't want so how to do something like that. Well, look, when somebody click first time we could increase, um, values of, for example, of a rival, right? Could this sign? I hear and we could decide like that. I malt free and as you can see it zero. So it is the first time and then we could increase the eye so we could do something like dead weight. I plus Plus Ondas you can see now it's then one a gang. It's too. And then when somebody clicks the third time, as you can see it, zero king, because Fremont's tree is zero. And then again, when we do the same thing as you can see is one. So every three times it's got this result is gonna be equal toe zero so we can use this information we can do something like the conditional statement that we'll talk about later . We could do something like if there expression like that equals to Obama zero, then we can do something on Well, things like that. We're doing future lessons. That right. But this is very useful for situations like that. When you want to do something when you want toe involve special instructions after somebody . Somebody, for example, creaks the bottom three times. Right? When, for example, you want Teoh have each tear draw being cold or something like that. You don't want to have all of them, but oh, but you want to print to the output. Many rows body want tohave only color that all each each had one Right? Then you could use something like the model operator. Okay, there's only the lesson. Thank you very much. 14. Relational Operators: Hello Today we're going to talk about relational operators, which are most time called comparision operators. Well, there could comparision operators, because when you are relating to something, you want to see how things two things relate to each other. Relations. Are you a connection between two people, right, and you want to compare how they relate to each other, and in our situation, you want to compare how variable? For example, I compares toe for able be so you want to check if they are equal if one of the very bodies , for example, greater than the other. Or maybe it's lower, right? So how to do? Well, let's greet of arrival, for example, for example, a. And let us thank you five. And that's great. Very Bill Bay and leads the psyche, for example. Seven. And I want to check if they are equal how to do it. Well, then you just need to use the compa reason operator, which looks like that it compares a two variables and checks. If very booth are equal and you might be like, Hey, but I can see here that they are not equally. Why do you even pulled her checking you. Well, you can see it, right? The program doesn't that the first thing? The second thing is that you don't know most time would values of your variables have, For example, you can create a form where somebody can put things there, right? You don't know what numbers will be there, For example, The numbers can come from database. They can come from the file. They can come from the android application. Other than that, many examples like that. So right now we don't know how to do other things like that. So we're doing just basic things like that so you can compare, right? So let's do something like see out and ah, system out front line. And let's compare a to, for example, be. And as you can see, we have got here now something. Think force words that why do you see here? False? Because five is not equal to seven. Right? If I had here five and here five you're not is that we have got here truth. And now we have just discovered a new type of Arabia. We just go bowling, OK? So we can create a very able to discover bowling and we can call it what everyone. So, for example, is, for example, to and we can assign here, for example, I equals being right like that and do something like that. As you can see, it's the same so you can save to the bowling type on the true or force so you can save your faults. As you can see, it's working. You can say few, too. It's also gonna work, but you cannot decide here and other value so you can hear inside. Five. You can thank me 10 It's I'm showing it now because if you had program another language language, these things would mean something. In this language, you can only thank you true or only sign false. Okay, so, um, that is the bowline. And that's how comparision off to variable work. But you need to remember, and it's very important that this operator is used for what? For checking if two variables are equal. But these operator, where you have got only one equal sign, is usedto a sign right. This is very important because some people make a mistake like they try to, you know, instead, off comparing the assigned by mystical in the math. When you compare feelings, you're just comparing using the one thing. Okay, that That's why some people have a problem like that. So I am just, you know, telling you it now and taking so much time just because so you would not make a mistake like that. Okay, so this is Ah, this is that. And you might be also asking yourself Hey, why do even bother using it, doing something like that? Well, in the future lessons, you will find out that there is something good is called conditional statement. You will be able to do something like if and then you can, for example, use something like if, for example, a equals B then I can prick print something like test right? And you're not is that we can see test here if we change the values, for example, like that we're not, is that nothing happened, right? These a conditional statement. You can check if something equals to something and you can decide what to do. That's why relation operators are We talk about conditional statements more in next messis and well, let's talk about other relational operators. You have good relation, Operator like that which just checks. If two variables are no equal to each other, you have got also something like greater done right are equal to So if you do something like that, five is not bigger. Done. Seven. Right Ondas You can see we have got here Falls Onda. Well, if we change it to five, as you can see, we have got fescue always working fine. Of course you can use the single corrected like that. It's checked. If something is greater than so something, something goes right. So it would have something like that. It's gonna return Teoh here. That's why we have got you a test on if we do something like that while five is not greater than five so we will not see a test. And of course, less than and less than or equal, they work the same. So you can just train a bit and do research on your own home. Dis operator here. Okay, that's going Good lesson. Thank you very much. 15. Logical Operators: hello today Are we introduce you the concert off? Logical operators. Logical operators are gonna operate on logical values, weather, logical values, logical values is to or false. So these are the values that we learned about in the last lesson, right? They can be stored in the bowling type off. Vory So it's gonna work on through and forces. But before we gonna learn them, I would like to show you why do we even need Let's create a variable. So, for example, a and landed sign to eat five. Let's create a very able being unless assigned to it. For example seven. And we learned that we can use something with this called conditional statements to compare something right, Right. So we could do something if and then if a equals to be, then we can show to the output for example, to right now it's not equal. Let's change it. It's gonna vehicle. And as you can see, we can see here it's true, right? But what will Kappen Eve, You have one more variable here. So for example, see, And it would be seven and I wanted to check if a equals Toby And in the same time, I want to check if the sea is greater than B. Then what? Then we need to know logical operators. But the situation is for you, very theoretical. So you might be Hey, it's not something that makes me think that these operators are gonna be important. They will be very important because logical operators can be used in situation. For example, like that, when you have a desktop application, you can have a form in there, right? And imagine that you have good now a string, for example, part thwart. And here is possible to somebody, right then another string, for example, repeated password. And, you know, we can see if that guy repeated the password the good way so we could compare if password equals rape it possible. And for example, if is a terrorist off condition checked and we could save you through or forthright, we could now check using the logical operation operators that we cannot talk about soon. If the password is the same as the repeated possible and in the same time somebody check that terms of condition. If not, then we just not allow him to do something right. If I didn't register and things like that. So it's just up to you what would happen then, using the conditional statement. But in order to do something like that, you have to know logical operators. Otherwise, it will need to check everything in another conditional statement. Do take lots of time. It would be just horrible. And while you can use logical operators to, for example, change, check the range off, um, range off numbers, but well, let's go into logical operators. So we think and final ISI would our day Well, the first logical operator, the easiest one is the exclamation mark sign, which is the negation off operation. It is like saying no. Okay, so was this something like, see out on Let's do something like to. As you can see, we have to heal. But if you do something like that, we just changed through two falls. So to it's gonna be false. False is gonna be true. And it issues most time in situation like that East times off condition check. So we could decide like Eve not checked. Then do something like Bob above, up, right. That's just up to you. What you would do that For now, we just know that we can just bring something. There's nothing good about that's how we do it, okay? And the next cool one is the conjunction and use the to upper sent science in order to to use it. So conjunction is represented by the end. What, and it means that you need to have both expressions two at the same time. Well, this expression expression is just something like that, right? If it's a it goes to but being okay, it's equal to bay something. It's too, and now we can, and in the same time see is, for example, greater than five so greater than a where. Whatever Lett's just like you fight yeah, is greater because seven is greater than four. So we're gonna see test you. So contraction allows you to connect. Write two expressions. That's the first thing. But when it will return fourth or it will tend to, well, conjunction. It is true only if both expressions are true in the same time, because it's the world and right, If you say something like that, well, I am going to go to the cinema tomorrow and I will buy popcorn. It means that you are telling that you would do both things right? You're not gonna do go only to this, you know, Are you are gonna on by Popkin gonna do both things. So you have expression one. Let's create a table and expression to and the result off the that. So if you have, for example true and to it's gonna return to If you have to and Falls is gonna return false falls into it's gonna return falls and False and Falls is gonna return fault So it's on Lee too, when both expressions are too So let's write it up So come junction It's too only if both expressions are two in the same time. Okay, And you have got also something good is called alternative and use these signs him and well , you use the word or sometimes what most time it's called thes junction But I think the alternative is a better word for it because it gives you alternative option when you have expressed that whether it's cooking because I don't like to write the results will be just different. Alternative Say's something like, Hey, I want to choose the alternative good option and imagine that good option is to option False means that almost something is just working. But so if I have a good option to choose and another good option to choose, which is one of them, so the result will be true. If I have a good option and that adoption, I just choose the good one, right? I don't need to choose the bed. One bad option. Adoption, Bad option. Bed optional. No, I don't have anything to choose. So I will have to choose one of them. And it's false. Done right. Okay, so these junction, it's falls on when both expressions are falls in the same time that there's a different beating. Conjunction and disjunction, right In this situation, both need to be false in order to make it false in this situation, in order to make it true, you have to have both expressions too. So we use that alternative here. You will not. Is that well? It is five equal to five. Yes, then well, you don't need to check the other Paride because five physical toe five, it's frozen. It doesn't matter what we've happened here. If it's even false, it's gonna execute the in section here sequence. But if you make both expressions faults so it's a nautical, Toby. Okay, so we can say that it's false, this expression and if sees greater than for always greater Some We have to increase it, for example, here to five. So it's see greater than 1907 He's not great into the night. Okay, so both are false in now. And because of it, we cannot see the taxi, right? That text it is no Visy boot. The, uh, condition is not As you can see. We can't say it, but if we change it even one off the expression to to balm it's working. So logical operators allows you to connect two expressions and because of it, you can do some at five events compa reasons, right? Okay. There's only good lesson. Thank you very much. 16. Bitwise Operators: Hello, my friend. Today I will introduce you. The bid wise operators beat wise operators, allows you to work with bits. Bit is the most basic information that your computer construct. It is zero or one. These are impulses that your computer electronic impulses that your computer is gonna interpret. Okay, there manage sequences of the 1010 1000 millions off off sequences and they are interpreted to everything that you can see. And you can work with the Zeron ones using Budweiser operators. Okay. And before we start learning them, I would like to tell you where you can use this knowledge. You can use big bites operators, for example, when you want to compress data when you want Teoh, do some data encryption when you want to work with colors when you want to communicate between ports and socket. So this is a topic about connection between computers. So if you are not interested in topics like that, you probably don't meet to know this too much. But if you're interested in topics like that, it is just a mask. Help. OK, but it's good idea this to know what's going on. You know, it is a good lesson to know how to do to see how some things are done in our computer. So the before we go into the binary code, which is zero and ones we have toe talk about our coat, which is which is decimal coat. When I have number 126. This is truly something like one multiplied by 10 to the power off to plus two multiplied by 10. Multiply to the power off one plus seeks multiplied by 10 to the power off zero. So, as you can see, here are the numbers from that from the decimal number. And here is then here is common in numbers are in our system that we're using Do you know can't. So it's then and as you can see here we have two while and zero which re President presents that position here These the first position. So here is zero. We're counting from zero. So 012 and it's gonna be the same for the binary code or another coat when you have a number. For example 1010 That's changing toe. The decimal number one multiplied by two because these Obayan Eriko to the power off 012 Free to the power of free because it's on the but four positions of Formula One is free plus zero multiplied by two to the power of to plus one multiplied by two to the power off . One plus zero more deployed by two to the power off zero and it equals still what one multiplied by two to the power of three is eight plus zero multiplied by anything is always zero So zero plus one multiplied by two to the part of one is still so it's 3 to 2 and zero multiplied by anything is zero. So when you look at this, it is stem. Um well, this is that tan when you would do something like, for example, anti Jer A. And you assign tent this integer you re reserve in our from a place started to bits and there are 28 zeros. And then there is 1010 Okay, that's how we work. And 10 ones. You of course I didn't count how many. So this is the number in the binary coat, and you might be like, Do we have to really do so much operations in order to can't this to this every time. You can really do it a bit faster. I will tell you how to do it. Look at this. Here here we have zero multiplied by two to the power of to when you have zero. The truth is that there is just zero because zero multiplied by and I think is always zero . So we can just or something like that. And here's something like that. Okay, so it's smaller, not right. And now you know that the one when one is multiplied by anything it is no trouble. It will not change the I think that happens. You're right. We did not change the results so you can look like that and this can see now It's pretty simpler player than the thing that we had before. So let's try in the beat when you have 111 on for example one. What is this number? The truth is that you can just think something like that here is start. One here is still to hear stood for here. Still a So these are numbers that you get the power off to. So it's 1 to 4 egg and then 16 years 32 64 128 156. And so And because we have got here always once, it means that the result off this is a 12 14 15 right on. And if we had something like 1001 it means that we have as a result walk here is start one and he restored a right. We do not care about the zero here. We just think about place, places that have good one here. So eight plus one is nine. So you can very Farsi world is under number like that. Okay, so now we know how the binary code is working. Now we need to learn how to use the bed wise operators. Finally, let's start from the bid wise And as you can probably notice, it looks very similar to the conjunction which had two characters like that instead of one . And it also is gonna work very similar because one is really true. Zero is false, but only off course for this operator. OK, so do not assume that true is in Java is one, because this totally different time. But it will be easier for us because we learned that table in last lesson and we said that the conjunction is too so twice. And it's true on the above expression. And in this time, if both, um above wants are the same. So we can do something like that that's sent to the output something like a in conjunction without maybe 10 in conjunction with, for example five. So here is Stan, right? Let's great fight night. So it's 0101 Here is one who is force of four plus what plus one is five. And when I do a conjunction, what will be the result? So while and zero in conjunction is zero because we don't have to. Once you zero and one gives a 01 and 0001 Give us here. So the result is here, right? If we had something like for example, not then but for example 11. So we had something like No, you have in here. The result is what one But you can see It's so it's long OK, but you might be now like really, where can I use something like that? This is looking like very unuseful things. Well, for example, let's imagine situation that you created some kind of form and people have their privileges and you can start privileges in something like that. 0001 00100100 and 1000 And imagine that this first, you know, if he's representing that, somebody can add it falls next one is for posting the sick. The 3rd 1 is responsible for, for example, deleting. And here you can, for example, um, bomb somebody, whatever. These are privileges and you cannot go. Go So on so long, right I did on. Then you can assign pretty easy in very small number to somebody that hey, you can do something like banning people deleting things and, for example, you can pause, but you can add It pulls so somebody can do this. This and this. Okay, And this number is equal toward Well, this number is equal. Teoh, Um, one plus for this 55 plus eight is 30. So if I do something like 13 and for example, one. So I am checking if he can add it as against to see the result is one right Let's check if you kick and post the post. He's really the number two. Right is the number one who is due. He's for reside. So if I do, starting with the conjunction off Paul's with you. Still you notice that we have zero. So this guy cannot cause anything so we can start many privileges in one small integer instead of manner. Variables. And we can then sec if he can. For example, if the person can pose by comparing something like that with something like that. Pretty coat, right? So this is just one off many usages. My think he's one of the most popular one. At least four people cool with not compressing do other things I did. Okay, so we have other So Budweiser working the same like the alternative logic, right? But with the pits. So let's change it here out to 19 and 13 with alter native off. So is what might be Let's use this number. So it was 11 and here we have got start five right, so 11 and five will give us what while and zero gives zero because we choose out the native option, which is one with here and one. It's also 11 and zero. It's 11 and one is one. So it's gonna be a you can see 15. You have this situation like that. So 11 1 in this situation, zero z and the yogis has zero, and the result is one to free plus 8 11 So that is the operator alternative, and you have good. Also something called the skulk sore, which I presented here it is exclusive, or and it differs from the normal or ain't that thank you. Normally, these would be true one and one would give you true right but the exclusive or says that it's equal exclusive right? You can have on the one option that you can choose. You can have two options you can choose and are good. This how you can remember so one and one is here. And as you can see, the result is stand. That's because one and zero gives you 00001 and zero g zero, but one and one gives you zero this time. So that's why, as the result, we have got that. So when can use, for example, So in a situation like that, sorry school, Because look, sore is gonna return. Always zero if both thinks are the same. So you can check for equality using, for example. So if anything is a bit different, is gonna return value that this different from zero. So there is one more two more operators free that allows you to move its the left. So, for example, if you type something like one and let's move, it's five. And let's move it to the right by one. As you can see, we have been took you? No, maybe to a visa to present your 10. We have about five years. So he would have, for example, number 10 right? And this number, when we do something like that, is gonna be moved to the right by one, everything is gonna be moved to the right by one. What does it mean? Well, these one with the here. Right. So we have something like 0101 because there are many zeros, right? I remind you. So this will be 010 woman, and it equals to what one plus for which is five. So the truth is that we divide it. This number by two Typing Q one. If we did something like that, you gonna divide it again by two. So here is how many times going to divide this number in this place to the power off to the power to to the power of to this time maybe two to the power free. How many times want toe divided right by two. So that's how we work. Of course, when we just times like that, you might be dead. But But why? It's still no. 2.5 five divided by two is stupid fight because these in teacher right there is no double number. So that's how it works. And right, left shift. So moving to the left side is gonna multiply it by two here is gonna multiplied, bite to end in a game by two. So it's gonna be 40. You're just moving everything to the left side. You could Also, something good is called bid wise. Negation on this is gonna change. So, for example, when you do something like that, as you can see, these number two minus 11 might be like what investigation is changing one's two zeros, So this zero becomes zero, and these zeros. I know one, but hey, look how many zeros we've had here before it. So we had so many years. And now they all want. And when the first bit is one, it will represent the negative number. Okay, That's why it looks like when you use the car lighter in the windows when you creek 10. Here. As you can see, here is our 101 And here man is years. And when you click, not as you can see, the 1st 1 is here. No one. And that's why we have got number. That is just not a positive number. Okay, that's only good lesson. Thank you very much. 17. Conditional Statements: Hello Today I will tell you about one of the most important topic in programming, which is called conditional statement. As the name suggests, conditional statement is the instruction a statement that allows you to condition things that happens in your program. So, for example, went in future, you will learn, for example, how to program and and growing applications. Somebody would put something to the phone, for example, his email address. And you want to check if the image others in the first input is the same as that repeated any others, right? You want to check if something is equal, right? So conditions are used in situations like that. You want to check what is inside a variable? Because, you know, right now we just know that you can create a variable and you can assign hear something and we already know words there. So it will be like hate. Do I really need to check it? Of course, there are many other situations. When you gonna use conditional statements, For example, you want to run some instruction as long as what s, for example, ever able will be equal to 10. Things like that are called loop So we're gonna talk about the usages in other lessons. Right now, let's focus how to use conditional statement. How toe make it work. So in order to do it, you type award. We just called. If so, it just checks if and then we say in the parent Is is what do you want to check? And here should be an expression. Expression is just something like that. For example, is five greater than seven? Okay. And this thing, as you know, returns true or false, right? It can return to our force. And if expression is true, then the instruction that is below this conditional statement is gonna be executed. So here we type instruction that is gonna be executed. If the expression is true, If it's false, then this instruction here is not gonna be executed at all. So let's check it out. If a is lower than be, then I want to see on the output. For example, A is lower than be. And as you can see, it's true. But if I change, he value to for example, 15 will not say this statement. Sometimes you want to check more things at once. For example, I want to check if hey is not lower than be If house If a is greater than being, then I want to put into the output. As you can see Now we have got here. A is greater than be so we can check all possible things that happens. But who? We didn't think about seven, right? Is seven equal to seven years. So it's not that condition. It's not dead condition and you can do again else if a equals B and then a print to the output A equals being. But you can also do something I didn't as autopilot else. If all other conditional statements were false, then the instruction here is gonna be run. Okay, so that's how you can make your conditional state and the big longer when you want to check more than one condition at once, right? If this is not happening that I want to check. Hey, maybe this is capping. Oh, maybe. Well, all these conditions were not bad. So I want to execute the instruction here. You can, of course, check here more instructions. Right? You could check here many, many more. But if you did something like that, off course then. And the instruction here, something us happened. Well, will not happen, all right, Because we just check all possible situation before, but in some situations, you might want toe do something like that. Okay, so let's leave it like that. I would like to also show you that you can have more than one variable. What? Well, you can use the logical operators here so you can do stuff like C equals Stan. Right? And you can do something. Like if a is lower than B and in the same time, see is greater than for example. Ah, 56 Then I want to see this. At the moment, this is through right on. And here seven is not lower than be So we'll see this message here. Something else happened. But if I use, for example, alternative, right? And we know that alternative, he's working like that, that you can choose that option that this to so CE is bigger than six. So the result off this expression will be true in a way. Right? So we'll see this message here here. What is not true? Because it is not lower than the but we could right here. What? Everyone, right vehicle? No. Crazy see is great. And then six, Whatever. The truth is that we are just learning how to do it on some Ah, theoretical example. Right. Okay, so that's how use conditional statement that during the lesson Thank you very much. 18. Curly Bracers: Hello. In the last lesson, I told you what our conditional statements. Now I will show you a problem that happens when you want to execute more than one instruction. If the condition is through when the condition is met. Right? What will happen if I do something like that here? As you can see, we have gotten error here. It's not working at all. Why? Because Onley one instruction is gonna be run if the condition is met. If you want to group more than one instruction and you want to make it to run like a one instruction, you have to use curly braces. Okay, When you do it that way, you say that the range starts here and ends here for this conditional statement in the line 19. As you can see now, everything works fine. So here is also arrange for dismasted. The here is arrange for this class. We don't know exactly what this function and cause right now, but as you can see, curly braces are used to say where something starts and where it ends, right? It also is gonna make some other things. Like for example, ah, when you create a variable here, as you can see. Um Well, for example, let's go it, Dean, Because you have got a B and C D here. It's not gonna be You are not gonna be able to use it, for example here. As you can see, it doesn't exist. You right? You cannot around this program minimal. Why? Because everywhere able after the curry brace, sir. And in current occur the bright sir, and is met is gonna be destroyed by something with this called garbage collector because it is not gonna be needed anymore. Okay, this is called local variables. We talk about things like that in Well, another lesson also. But well, this is the first glance into these top. So this is Carol Bright sir. And you also should know. So you do not make me sick because some people make a mistake like that. They want to execute, for example, something like that. Only if all conditions were not met and when they executed. As you can see, we can still see the message. He right message here is gonna execute always. Why? It's gonna execute, always even toe. This condition was met, right? Well, you need to remember that when this condition is met, all other conditions are not gonna be executed. Well, is because like that? Because the truth is that white spaces are not interpreted, right? You do remember that, Onley one instruction is gonna be run if you want to make sure that this instruction is gonna be executed on Lee when all instructions here are not. And well, when all conditional statements here are not met, then you have to remember about creating here a scope, right using the Carib risers, we want to group these instructions in tow. One instruction using these curry braces. Okay, that's going that lesson. Thank you very much. 19. Switch: Hello Today. I would tell you about conditional state, and we just called switch. Switch is used as the name suggests to switch between the values off there. I think that is gonna be sent to the switch. So you created variables. For example, A. And you're signing teat 50. And you created switch and you sender variable A. You can switch between cases. So for example, case 15. I want to then do something like sent to the output is equal to 50. And if there are on the other cases, So let's create other cases. 15 and still, for example, 100 150. So 150. And if it equals, start on a different value, then I want to send to the output is different. It's not 5100 150. And who can say a equals, for example? A right. Of course, this is very impractical example, but I just want to show you how switch is gonna work. So as you can see, everything got executed. So did I lie to you? No. Well, they're sweet is gonna execute everything after one of the case is met. So we have got here a value 50. So everything is gonna be execute after these case. So this this this and this. If I had, for example, 100 you would notice that only this instruction these instruction, these instruction would be executed. All right. Okay. When you go to 150 on the decent days, if you start total, it's something different. Only this. But if you had default here, notice that everything got executed in the way. So east switch even use able. Yes, it is because there is a special instruction which is called break. You can break toe. Totally the case. Well, you have to break it if you want to stop execution. Because, you know, here you don't have something like curly braces To show where the case starts and worried ends. Right. Well, this will not work. Okay? I'm here when you do it that way, it's still gonna execute everything after it Will everything on the Braghis met. So 50 and 100 was executed, right? Curry braces here is just not working like it should get would break the switch. Okay, You have to type the break instruction in order to make it work like that, but you might like. But it's something like that, you say. But yeah, you can do probably something like that. If a is equal to 50 and it's maybe 100 so so is like alter native right. If it's equal to 50 or it's equal to 100 then show that a is equal to 50 or 100 right? And then you can see that this thing got executed right? And well Ah, the case 150 wasn't executed, and default wasn't executed, right? You don't need to type here brag because, Well, it's the last instruction here. So this thing is not needed at this. If the default is at the end. But you might be wondering, Do you need the switch? If you can do really everything with the conditional statement that you learned about in the last lesson, you don't need it. The trove is that's rich is on the looking a bit better, right, because you have got everything shown. Case by case you can look at these and cold might be a bit easier to read. The truth is that I have almost never used it. This is you should just know it because some people might use it. So it's good idea to know the syntax, right? So you know how to read it, how to read the code written by other people. And it's also a good idea to know that you can't send the switch double because you can't compare doubles. Doubles are just, you know, have got bread precision, and it's very hard to compare something with fraction, right. You also cannot compare. Something good is called string because strings must be compared using something goddess called equals method. But we'll talk about this about this in the future lessons and well, you can compare characters. So if you wanted to compare characters, you could just type here something that right, using the apple stuff. And if the character was like a capitalized this thing will be run. As you can see, the case he was met. So everything is gonna be run until the break is met by the interpreter of this program. Right? Okay, let's changing. But integer. And here 15. That sounded lesson. Thank you very much. 20. Conditional Expression: have I told you that programmers are very lazy people, but an intelligent way at the DEA's lesson. Human notice how badly they're lazy. Okay, because let's imagine a situation like that. You want to check if there number is even for its all too right, so the even number can be divided by two, and the old number cannot be divided by two. In order to check it, we can use conventional state and right so we can create a variable like that in order to see if these variable is really ought. Or even we can do something like that. If X Model two equals zero, then it means that it is even because six multi 20 right, so it's even it's can be divided by to Otherwise we can put the output. It's out for able. As you can see, it's even when I change it to seven. For example, it's odd because seven months to is just one, so one is not equal to zero. So here we have got false and this thing will be executed here, right? Because condition here was not met. So this condition is gonna and but the instruction after this condition is gonna be executed. And now look, programmers are very realizes. They said you could write it dead way. Mm. If then, even otherwise and you can save it, for example, to is, even the Rabel and you can send to the output scared him. Now that's coming. It and this you can see. Oh, when you do it that way, it's even so. This construction is called conditional expression. When you have something very small to check right like this, you can use conditional expression, which looks like that first you type expression, then the think to execute if expression, it's too, and then after their column, the thing to execute. If expression is false, that's how you do it. Don't use it, of course, for something bigger just for things like that and on Lee. If you think what the truth is that it might be sometimes more read able. But sometimes when people to not know how it works and believe me, some even advanced performance, forget about it and they have to go to there website and look about what is these things here? So maybe it's even better to sometimes right more right But this you When you meet a call like that, you would understand how it works. Okay? There's only the lesson. Thank you very much. 21. Arrays: Hello, my friend. Today I will tell you what is an Ara Ara is a sequence off variables that are start next to each other. If you want to create more than one variable at once, that has good, the same type and they are connected to each other. Somehow. You want to use Harry? Why? Because Imagine a situation like that. I am telling you. Hey, create 50 variables that we store numbers. What you will do, You will decide like that in teacher then? Ah, variable one. But we're able to variable free very before Babul five. Okay, I'm just kidding. I'm not gonna go toe to do it 50 times, but now you can imagine this situation, right? And now imagine that I would study. We don't need 50. We need even more. We need 90. We need 10 thousands. Okay, That will just take forever. It would be hard to, you know, even check. World value is where and other things like that. That's why we have got something good is called an area. Because we can create using a syntax like that. And Ari So here is the name of a right. And here's a type of a right. And do you just need to add the square brackets like that? And now he created an area. Now it's empty. There is nothing there. You didn't reserve anything in the memory. If you want to reserve something in memory, you have to take something like that. All right, equals. And then you tied the keyword new, which says, Hey, I want to reserve in the ram in the random actors memory right space for the thing that I will type right now. So four integers and I want to say how many vintages I want toe reserved their, for example, on authority. Right? So we instantly created, like charity variables. That type is integer and we put them next to each other because they are next to each other because they are really 30 multiplied by 33 beats, right, because integer is 33 beats and it's multiply bar 30 and they are next to each other right in our memory. Because of it, you can access them very easy using something what is called index. So, in order to access, for example, the first variable right, the first value off the area you need to type something like name of all right and then use the square brackets and type zero. And as you can see, we have good as the result Here, zero every Tiguan. It is also zero. It's because the area right now has good default values for the integer. When you do not a sign, anything manually that is gonna be zeros. But of course, you can change these values. So, for example, you can type here 70. And now when you access this first value, as you can see, it's 70. You might be also asking years of hay, but you're using zero here. And it's not fair that you should use one. You should start counting from one. Well, yeah, we are counting from one, but in programming, you have to remember that. All right. Have to be counted from zero. Okay. From the euro, you're counting in Texas from zero in a rise. That's very important because many people make mistakes like it. So if you create an area like that, you really created free vory both. But the 1st 1 is at the index zero, then the 2nd 1 is that the index one and that her? The last one is that the index to Okay. So in order to access the second element, we type, for example, something like that. And the last alignment, something like that. And now, of course, we can access all these values doing something like that. As you can see, everything is working. Fine. But we have to. Also not is that you cannot access things that are out off, you know, reserved memory that we reserved in our in our rahm. So if we do something like that right now, we don't have an error. But when we play oh, now it's wrong. Right now we have got a net over here and we have good exception that something happened. We are Index is out of bones. Bounds exception, right? Something is wrong. You cannot access something that was not reserved by our program. Because you have to know that when you are running your program right, you are reserving memory for this program for over eyeballs for the program itself. And if you do something like that right like that, you want to act as a write off index free, which it was not reserved in the line 17. Then you are trying to act to something that could be reserved by another program. For example, the that means, for example, that recording to the dying, using whatever right? So that's why you cannot access things that are not reserved. Okay, in the random access moment in our room. That's why we need drama idol. I mean toe reserve. Eso a raise, as you can see, are very useful. You can instantly reserve lots off space in incident. There are other ways off, you know, declaring Gary, you can do you also that way because spaces are not interpreted. But the convention is that in at least Java you should treat them that way. But this is the thing that somebody some people do not know. You can also declare it dead way. But as I said, convention is to do the dead weight. And now, finally, you have probably noticed that we are getting We are starting to know what's going on in our program. Hey, here is a string and the type of the string is really well, the type of this variable here is really not only string, it has good this square brackets so it means that it is an array. So it means that here we can send from from example another program or, for example, from the council toe our program arguments right are extends for arguments. Of course, I could call it whatever I want. And it will be around because this is a name of honor right here. Right, But decreed arcs because, well, it's then self descriptive. And that's how all variables should be called. So here people can send many arguments that we can later use right we could this affect our X zero? If our zero equals Teoh open, then we can, for example, open something, right? That's how this thing works. And the cool thing is that because off it, because it looks like that you consent more than one right, that that's very, very cool. You can reserve Memoria as in normal variables, you can assign values to normal variables. In one line you can off course things like do that right. So you can do it in one night and everything is gonna work Fine. You can also initialize alright like that, for example, Let's go it our right to and you can assign values into airy instance. You can do something lying that and later we can access. For example, the first element, which is 124. So it's a Deposition zero like that. And as you can see, it's working fine looking with 124 here, right? This solution is rarely used because most time you do not know what would be inside a narrow. What values will be there because they are sent from, for example, database from the five from the forums under things like that? Okay, but it's good idea to know, because there can be situations where you want to initialize it in one line. Okay, because you don't know exact exactly how many things will be here. The cool thing about this solution is that you can adhere new things, and the size will increase automatically so well. There is also one more thing you can get using that dot length the length off the area. As you can see, it's 512 free for five, and it's very useful to know how many things were putting to an IRA because of a duking access. For example, last element of the area Because the last element is at the index in our situation with 01234 As you can see, the land fear is retiring. Five. So if we did it that way, we're gonna have a number four. And we can use this value as the index. Right? Like that. As you can see now we have good here, 55. And when I at you, any number right? And there is the last element here, we're still going to access the last element. Okay, that's only good lesson. Thank you very much. 22. Multidimensional Arrays: Hello Today I will tell you what are multi dimensional a rise. But before we go into multi dimensions, we need to think about what this a single dimension single dimension means that you go into one way. For example, you have got a role here, right? The horizontal row. And this is a single dimensional Eric. But when you want to add columns so when you do something like that, you are going to ways you go horizontal way and the vertical way right. And then you can create a two d game, for example chest right. You can then put, for example, some poems or another figure that exists in chess game. Of course, you would need to increase these by the column size with me to make make it fix right. But now you know what I'm talking about. These multi dimension. We have got horizontal vertical. If you wanted to create another dimension, it will go like to you. To the monitor, right? It will be free. Dimensional. That's how we have good objects. In real life, we see everything as it was in the three dimensional space. Right now, the indexes are gonna look a bit different here. We gonna have the number off row, and the second index is gonna re present. What is the number of column? Right. So here, we're gonna have one. He's gonna be dio but he's gonna be free. And here is gonna be what, um, won the game to free one to free on to make it a bit better The third way. Bum on dumb. Okay, so that's how that two dimensional area looks like and how to create it. Well, before we're doing something like that using the one square Barket now, we just used to square Barket you. We wanted to create three dimensional free 4567 Right, So these are two dimensional. All right? And now we call it, for example top. And now we initialize to it. We are reserving in our memory space. For what? For anti Jares and I want how many rows? 1234 So I type here for and how many columns I need one to free. So I type free. And now we created two dimensional art which we can change. So for example, we can do top off 2.1 on I want to change it to, for example, 99 then we can send you to the output as you can see the result. Isse 99 suddenly changed their value off this guy here. And remember again, I'm telling you that you have to count indexes from zero. That's why we type before even told you can see here that here is free because the first always you can see it's called the year zero. OK, remember about it because it's very, very important and you can initialize also multi dimensional, right? Also in one night you can do it, deadweight that two equals. And here it's the semi column and now you have to create rows. Each row should be inside. Carried a brace. Okay, so now you can say that I won't hear value like that, like that, like that. And if you want another row, you at you a coma and then carry brighter Bram uh, another, uh, on another like that. And now let's train a bit. Let's think about how to get to, for example, that guy that is killed So this is the last row, so we should type top off too, and the last row is 12 free for, but you have to come from zero. So it's free and in order to get to the second color, just gonna leave that one here because the first column is a D Index era and the second column is a index one that says, You can see we have good here now minus 50 feet. So that's how you create multi dimensional I rise. And as I said, you can create it to use it, for example, creating two dimensional games. So that's all in the lesson. Thank you very much. 23. Loops: Hello, my friend. Today I will tell you what our lips look is a solution. A solution that allows you to execute as many times as he won't instructions. Because they're within many times in your programming adventure when you want toe run instructions more than ones which are very similar to each other. OK, for example, as you can see, we have got here an area area off video courses. And the type of this area is strength. So we have got here for strings, right? And what and how would you do it if you wanted to print all this? Things stood out. What it would do something like that. They would get into that all right, and then type the index of her. You would come pick it three times, and then you would do something like that and you would executive Okay, it's fine. But now imagine that we have another coast, for example. Ganja. Yes, right. And when executed, we don't see it. So we have to change something in our coat. You have to remember that when you are writing a coat, your coat should be universal by universal. I mean, you shouldn't change your code when something changes in data, your coat should work dead way that it's gonna work anyway, even if somebody at something to the something new to data. OK, that's how you should always try to program your co. So when you look at the coat, you instantly concede that it's very similar. It on Lee differs by these numbers. Here's and this is the time when you should think Hey, I should use a lip. Okay, So how to create this loop? Well, in order to do it, you type wife. This is a wild lip and then you create parentis is and in parentheses you type the condition of love. So, for example, why I is lower than for example, five. Then I want to execute everything between these curly braces. Let's create this variable which is called isil. For example let's create an integer you have to assign here a value right? For example zero. You have to start from something because if you do know the sign anything, we don't know what's in it. So we assigned here zero, and we are going to run instruction between discourage brace, Sir, Until this thing here is to this condition is too. Okay, so is zero lower than five? Yes, so we can print something out. So let's bring for example, I outside. Let's play as you can see. Now we can see that. Oh, really? The zeros are not gonna end. Never. You have to stop this program. Why? Because zero is Are we always lower than five? So this lope is infinite id? Look, infinitive loop is happens when your condition is always through. So you have tow change, this value and the under to change it. You're gonna use the operator are athletico operator that looked like that? You're gonna increase I after each time by one using this instruction here. So when I executed this this time, as you can see that have gone on a 012 free for why? Well, let's check it out. Is zero lower than five? Yes. So let's bring zero outside and then increase zero Well increased the value inside the variable I by one. So right now in I we have good one is one lower than five. Yes. So let's bring out one. Then we increase it again. So it's to lower. Yes, Free four. And then it's five lower than five. No, it's equal to fight. So it's not gonna print five just going up in everything from 0 to 4. And hey, this is something Something is gonna work here with that thing here. Right? Let's go. Patina we had here number 01234 So we're just gonna delete the zero here and put here I and Bomb. We just printed all courses that are insight here. We can beat this. As you can see, we just painted it pretty cool, right? But as I said earlier, your coats should be universal by universal. I mean, when I add something new So for example, sauce, As you can see, it's not working. So you should now increase here to six this number. But you shouldn't called your coat like that that you should know that you will later change something. Your coat when you add a data. So in order to change it, we go now get from video courses length off this area, using the length variable that we can access using the's dot Right? We told we I told you about, and these properties variable here on and it's gonna return here right now. What? Want to free for 123456 Right. And yeah, now it's gonna print everything up, and now we can add something totally new. So, for example, Java android, right? And bomb. As you can see, we edited because this property and has got all the ways, the value that it's actually in in that our Alright, right? And that's the program. That's how you should create your programs in your future. Okay? They should be universal. Okay, so this is a wild Let's create now, do I? Look, you can create a look doing something like that. Do why? I is lower than video courses that length. Right? Well, let's come in this. And let's boot this inside. Uh, like that. And when he executed, as you can see, eat works the same. Well, you might be thinking that it is working the same, but the truth is that if you change you the I know for example, that number it's gonna execute. Anyway, we haven't hear a problem now because this big number we don't have value inside this area , right? You can act. We can't access an Arab with so big index. Because do I Lope is gonna execute this thing at least once, so the condition is checked at the end. Okay, but if we take this under the common and we uncommon this section, you would notice Did the program that this instructions between this curry braces We're not executed the door. Why? Because condition is check at the beginning. So this is the only difference between dough I and why? Look, I'm sorry, my friend, but then I'll have to give you an exercise. You have to train. So what you should do? No. Please create a program with an area that size will be, for example, eight. And I want you toe a sign values to this area. In that way, the father first value in at the index zero should be turned in 2030 40 50 60 70 80 90. Well, I stole. I think that it should be size eight. Right. So something like that. So you should assign toe values something like that and then print all these values outside . Okay, So this is your home or go if you have any problem, just asked me. Create a discussion. I will have you so do not war. The delicatessen. Thank you very much. 24. Loop for: Hello. My friend today would like to introduce you another type of loop we just called. Look for And in order to use it, I'm just gonna change. Why toe for? But now focus, please. I'm just gonna add here at cynical and here a cynical and it's gonna work the same, like wild. So why even bother using it? Because we can at, you know, space and here's place. And these places here are reserved for the thing that should be done when the loop starts. So for the initialization off variables that will be needed in the so, for example, this I right here, we have got the condition, and here should be played, something that is gonna be executed after each time. The loop is Ron. So like it. And now it's also gonna work. Fine, isn't it? Kill. So this look, I think looks better than why. Look, because you have got everything that is connected to look in one place, right? It is not outside of the loop somewhere here. And the thing that is done after each time the loop is Ron is not at the end. You can just look here and instantly see. What is this look responsible for? I like for looked the most from the lips. Okay, so that's something like that. Here is the place for Inish initialization off variable. Here is the condition and here are things that should be done. She so, um, things to do after each iteration. So after each time the loop executes everything inside its border and that's all OK? And of course you can, you know, initialize you more variable silicon. Something like that that we're not using now. So we don't need toe and you can do with the common also increase increase inclement ation off more variables. Right? So we could do something like that and something like that, it's gonna work. Fine. OK, so this space can be expanded. You should also know that the condition here is gonna be checked at the beginning. So we do something like that. Nothing is gonna be shown, so the condition is check at the start. So this thing is wrong first than the condition is checked. Then this thing is executed. Then we are increasing their, um the value off variable. All I and then we check the condition again. Bom Bom bom. Uh, until the condition is not okay, That's how it works. So let's change it back to something like that. So, youth, do I look, when you want to execute something at this one's use for loop in order to, I think my dear called clear. Why didn't do? Ah, why? Look, I think it's most I'm used by. Other pro programmers just prefer it, right? Is it really the preference? So, huh, use the one that you think that you like, But I really think that this one is better because you have got everything in one place and it's easy to read in one line. What? That look is gonna do the donated lesson. Thank you very much. 25. Enhanced for loop: Hello. In the last lesson, we learned about the four loop and in that loop we had to type lords off things. Here there is an enhanced for loop that you can use for situations like that enhance means that is upgraded. Look, it has good and other syntax. It is easier for situations like that. So how to use it? We just dive there for them parentheses and of course, the curly braces. Where is the body? Off the form. And now we do not type the semi colons and we do not have displaces here first for initialization. Second for conditions hurt for things to do after each iteration. But no, we just type the type off the a ride that we want to parts that we want to get values from . So in our situation it is what string? OK, then we type whatever we want. Yes, it's stroke. You type Here the name off. We're able that will store values after each iteration. After each time the loop, we go through the loop. OK, so it was stir one in the first time in the first iteration C plus presidency operating on fires Java, Java, android and so on. So let's type your for example, my value, right. And then we type the colon, and then we type the name off, all right? That we want to go to. So in our situation is video courses, and then we just type my value, right? We just take these here because its stores the value after each iteration, and now we won't come on. This. You will notice that when we around this Hey, it works fine. And of course, now you can add new thinks here, right job, the database, for example. And of course, it's gonna be also added, So these looks, of course, centered in this one, right? But in some situations, it's maybe not the best. Because, for example, what if you wanted to have a the Rabel inside, you would have that we can write. You have to create it outside increments here because sometimes you want to check what it aeration is. And then if it aeration is equal to five, you want toe, do something special, right? So you can do something like that. And as you can see once after the 12345 in the 50 it oration with Tiglao off course. Must I want to do something different? But hey, now you have got against something outside, right? So it really depends on what you want, toe. Exactly. Do. And you need to also remember that here, you can do whatever conditional statement you want. You can do here. You know, we can use the ah Amper sounds right. You can use the contraction, these Yanks and other things like that. You can do whatever we want. You here. You don't have something like that. You just go to all values inside. Okay? So it really depends on situation. Well, do you want to do? Okay, So let's take this other command and let's arm do comment here. And you will notice that sometimes even your i d we have you covered too far up. And as you can see, we instantly Ah, that the i d converted it instantly. And it also gonna work. Right? So we can There was this Concede control. Z control. Why? So that's that's the difference. Okay, The doing good lesson. Thank you very much. 26. Loop in loop: Hello today will exercise it bit. I will show you how to create a multiplication table using a loop inside another loop. So it's another exercise. How to use loops and sunny Another lips, right? That might be a bit difficult stuff, but I think this is gonna be easy after I show you this simple example. So how the US multiplication table Luca Well, you have got something like that. 123456789 and 10 And then what you do You multiply all this values by too So good then 2468 10 12 14 16 18 and 20 And then what you do you multiply No days row but the first row again by free So you have got this free six ok and then what you Do you have you multiplied by four So for a of course you know how it works But you should look as a programmer on this like that Hey, I have got you one So I want to print ISRO and then I want to just multiply each time the same wrong by to them free than four And thats well we can use something client looks so let's create a for loop and we will initialize here variable I and were assigned to it one because we want to start from one, right? And then if one is well, if I is lower or equal to 10 then increase that value. I So we do. This loop is gonna be executed now 10 times. When we do something like that, we see numbers 1 to 10. OK, but I want them next to each other. So we will not use the method print line. But we use the method print. Now they are next to each other. But we want to have a space between here. So let's create this place like that, using something like adding a string with the class operator, right? And now is you can see we don't have got an enter here. We should add enter at the end. So let's do it. But let's do it outside. So we're gonna do it like that system out print line and we not gonna send anything there. It's gonna just and at enter here. Okay, so now it looks fine. And now look, we have got now this first row here printed using this instruction, right, because this is really something like running this instruction 10 times. But let's imagine the disease. One instruction that in salt a task for printing out the numbers. And now I want to multiply all these values by what to then free them for than five and six and 799 10. So it's also a situation where we want to create another loop that with the outer loop right, this will be the inner loop. And let's create out of four Let's create here. Ah, let's declare a variable, for example, J that's assigned to eat one. And if Jay is lower or equal to 10 then J plus laughed. And now let's take it into the current of racers and we just need to multiply I by J and, as you can see now created multiplication table. And the coolest thing about this solution is that we can now create even bigger multiplication table, and it's done instantly, right? That's the power of our computers. If we did it manually, do take jazz tons of time. Okay, so and let's focus on how it works, right? So let's do stuff like that in the common. And at the beginning, we're assigning toe J one. So it equals one. And we check if one is lower than 10. Yeah, so OK, let's let's go to this loop. Your do you have got an extraction here? So we declare I and we assigned to it one. And check. Hey, it's one lower than 10. Yes. Is Lord in 10? So Okay, so let's print out what? One multiplied by one. Okay, let's do it. And let's bring space. And then what? The instructor? That first part of these Look, the first iteration is gonna end, and we need to know that they think here is gonna be executed right at the end of the four Hope. So the eyes gonna be increased to two, and we're going check the condition if do is lower than or equal to 10. Yeah, it's It's so two multiplied by one is still and we can increase it. So free it's free. Lower than or equal to 10. Yes. Free multiplied by one is free. And then 456789 And and then 11. It's 11 lower or equal to 10. No, Okay, so it's the end off execution of this for low. We ended because the condition was not mad. And we execute the print line. That's why we have got here. Enters right after Pedro. And then we gonna walk. Well, the first iteration, the first pass. Because we could imagine here as it was one instruction, right? Let's imagine that it would be something like, you know, printing one instruction took this instruction has ended, and then we have to increase J. So we increase it to two, and we check the condition is still a lower or equal to 10. Oh, yes, it is. So the condition is met and we're gonna execute this thing again. But after you that four loop has ended. We lost the very well I so way are declaring here again. So it's again it called to one and to check its one lower or equal to 10. Yes, it iss So we gonna just show to the person one, but multiplied now by two. So it's school because now he was something like that. That right it with second road that is gonna multiply all these values by two. And because of it we're gonna see is the result Israel. Ah, And because we have been to free 4567 right and to 10 and all the time these these values will be multiplied by the static value to And after ending this this'll lope execution of this loop, Jay will be increased. And then we will multiply every number like that by free. And that's why we're gonna create another row. That's awesome, right? Maybe complicated at the beginning when you look at this, but don't worry after, you know, do things like that a few times you gonna feel flu ending things like that. So what you should do after business, and you should write it young on your own. Okay, this is a good idea to, you know, close this video now and try to not look into the coat here and try to ride it on your own would be a good exercise for this lesson. If you have any problems, just feel free to ask. I'm always Ito best records 27. Break and continue: Hello, my friend. Today I will show you how to break or continue the iteration off. Look what that's in section break and continue means so here we have a loop a simple one that is gonna show values from 0 to 9. And now imagine that we would like to see only the year old to for So I would like to see even numbers, right? Or maybe I would like to see old numbers The one free five, 79 How to do it? In order to do it, we have to know how to use, continue and break instruction. But when you continue for this one But it would be a good idea to also there about how brake is work. So let's do something that lets greet a conditional statement. If I is equal to for example six, I would like the counting. What does it mean when they executed you will not. Is that six disappeared? Why? Because continue is working like that. Stop execution. Both the interational. So one of the parts of this look right stop the execution of eight oration off the car and reiteration, but continue. So it means that every instruction after this one won't be executed. So this thing just didn't execute writing because more here like that. You would notice that Well, you have got when we should have here. Six. It's not that right? All instructions here from this place toe this are not gonna be executed if the continue instruction is executed. The break is a bit different. Is just gonna stop totally this for hope. So break knees. Hate break, man. I don't want to execute this loop anymore. Brake is used in situations where, for example, somebody clicks on something and you want to stop the loop, right? You could check here all the time. If somebody creates the button, then break. But well, nobody has quick anything. So there should be some operations executed, right? In our situation, we need counting, right? Because, well, we do not want to stop total execution of follow up. We want to c zero to for ah, seeks eight. And for example, 10. Whatever I want to see see even numbers or old numbers how to do it. Well, we could use the model law operation here, So if I multi two equals 20 we're gonna counting you. What will happen? As you can see now, have good numbers. 1357 and nine, Which are old numbers. Eso How does it work? Well, we assigned to hear toe I zero and we check is zero lower than 10. Yeah. So zero wanted to equals zero. Yeah, So this thing is gonna be executed. And because this is gonna be executed. Instructions after continue are not executed so well, not C zero. But later, when the eyes gonna be increased, we're gonna check. The condition is one lower than 10. Yes, One more to is one, and it's not equal to tense. The condition is not met. And, well, this continue is not gonna be executed because condition was not met. And we're gonna see on our Hugh Output one. So that's why we can see all the numbers. If you did a dead way, we cannot see even numbers. The coolest thing is that now we can execute large of them very fast. Right. Okay, so that's how continue and break works. Now, let's see how it works here when we have got to looping Southern. Other than so this is how the example What would happen if we do something like that? If I equals, for example five, I will continue as you can see the comb. Five. These appeared totally Why? Because every time when I was equal here five right? It doesn't matter what Jay was. 1234567 Whatever the instruction here was not executed. So we didn't want to ply five by 1234567 So that's why we I removed the column. Right Column The fifth call. If we did something like break here, you will notice that all combs after five days appeared. That's why Brake. That's because Sorry, That's because break leaves the inner for loop. Okay, is not gonna break Desslok on Desslok break. He's gonna just break the loop. That was that. It was executed in so dead one. And that's why when I was equal to five, it left because of the brake function we left the for this fall Look And well, these four loop seed execute. So the J was increased. And that's why we have got another awesome. It might be a bit hard for room start toe. You know John from something so simple. Like that stuff like that. So do not worry. You just need to trying a bit as an exercise. I like you too. Right now. Try to somehow print every second row. So you want to print this one? This one? These one. Okay. And if you have in the problems, they're not war. I will have you just created discussion. Discussion? That doesn't mean that lesson. Thank you very much. 28. Summing many values: Hello. Let's training this lesson and let's create a program that is gonna soon up. So at all the numbers that are inside this area, how to do how to sell the problem like that? Well, if you're gonna add each time a number, it's gonna be forest emailing extraction. That's why you should instantly think about using a loop, right? You want to execute very similar code. So when you talk so store it somewhere. So let's create a variable that we stole the sit some. So let's call it like that and it's good idea toe assigned to it. Zero. Why? Because when you're adding zero toe one, see, it's still one. You need to have a natural value in order to do something like some plus equals numbers off for examples here. Right then you are adding, you know, at least at the start value to the notary value. That's why it's not gonna change. You did something like that. The result will be different, right? And that's why we need toe assign here at the start zero. And now we need to create a loop so far, and that's creative. Rabel I And if I is lower than the numbers length and I plus block we assigned here to the I zero because I remind you that we number old values. We index things inside a rise from zero. We start counting from here. That's why we starting from zero. And now we can just at two, some some plus numbers of I And then we can just send to the output this sound outside of the look right. And when I execute, we instantly can see the result cars again, you know, Do you know something simpler? So one plus two plus free, it's six. And as you can see, it's working fine. You can upgrade either date. You can do something like that. It's gonna look a bit better, right? And you can upgrade it even more by using the enhance for all so we could type here the tide off the area. We won't do go to so end, then, uh, name over a bill that will be storing values after each iteration off each place. You right? So for example, number and then we type cone on Ben, the name of Ari wants to go to so numbers. And we were not types. I think that, but we just typed something like that. And as you can see, it's also gonna work fine. And it looks I think it's more read able men. Right? Okay, that's only the lesson. Thank you. 29. Object Oriented Programming Overview: Hello, my friend. Today I will give you overview on the topic that this cult object oriented programming. But before we talk about this, we need to say we need to tell ourselves what is an object. Because, hey, this is going to be oriented programming around the objects, right? So we need to create something in the Java language that will be connected to objects of what is an object, how to create it, how to use it. Why do we need it? So what is an object? Well, object is everything that you can see and you can describe. Okay. All right. Now I am looking at the monitor. I am looking on the things that I have got on my desk. There are lots of things here. It's even hard to, you know, move on my desk. That's how I work. But, hey, there are lots of things. They're all objects, and I can describe them. So in object oriented programming way, you want to describe things and you want to describe them because you want to call nicked all their things that are, you know, similar to each other and have them in one place for the future usage for future changes for easier future changes occur So object oriented programming. It's cool because you can work with many people because it will be easier to work with something that is, you know, set once properly. Okay, so objects Well, I said you are containers also that stores variables and function automatically connected to each other for easier future Use it. So, for example, when I'm looking at this monitor, it has good with it has good height. So this is the properties. These are features So part of something that describes the item Okay, this object and where this monitor can be could closed can be opened, right? It can be e I can change the brightness. So these are methods, functions and these describes the things that can be done with objects. Okay, what can you do with objects? Is this guy by methods and functions? So let's create this very simple one class of, for example, cost more knitter and a Class East's a form for creating instances. Instances copies off objects. Okay, so classes are used to create objects. So I'm just creating right now a clause that is called monitor and I am using the Curly. Brace it to say where I want to describe things that will be describing monitor. And here I am going to create, for example, of two variables an integer we even integer height, okay, and well with is gonna describe the waiver monitor. And Heidi's gonna describe the highs illuminator. And these things are called properties. Okay? It is very important. This is properties. And now let's create mattered. So something that can be done with monitor. Okay, So for example, void and ah, change brightness. Okay, Something like that. So this is a method method that can do something with the brightness. Okay. So I can also create a variable that will be called brightness, and it can be later changed using this mattered. So, for example, we can send an argument, other things like that. But we will talk about things that, like that in future lessons. Okay, So things that will be done by method are gonna be described between discourage brace er's and well, so this is place for instructions to be done. That void think can be really something. Guys, it can be bowling can be many types. It is the thing that is gonna be returned by the function when he's involved. But all the things like that, we'll talk about later. Okay? So don't worry about this weird keyword here right now. You just need to understand what is objective programming and why do we need it? Okay, so I just described a more inter like that, and because I have got the monitor one monitor, it doesn't mean that all off the monitors will be the same, right? Well, we can have many different monitors, and we can create using classes, right? Many monitor so I can create, for example, in the main mattered. Um, a new object using that monitor class monitor can be used as a type, as you can second type monitor. Now the name of variables off, for example, monitor one whatever. And now I'm gonna type equals sign and the new monitor, which means reserve for me in the memory in the random access memory at place for these properties. And this method good can be later invoked. Okay. And as you can see now, when I type more inter wam that as you can see, I can access the brightness that hide the with and I can change brightness, for example. Right? So let's access. For example, we even study toe 1000 and let's send it to the output. So like that, and as you can see Hey, it's working fine, right? Well, we could also do something like get with. For example, we could create a mattered right And we could send to the output the week that we have got here. OK? And we could do something like monitor one get we've using. These method is called invoking off methods. Okay. Um well, this ah thing should be looking like that. As you can see, we have got 1000. Now why we have to go have this here not inside the system out Prince line will talk about later. Okay, But well, as you can see, it's cool because you can now have seen things methods connected to monitor here we because right now we have got very small programs, right? Imagine a situation where you have a good big program with, like 10,000 off lines. It would be very hard to keep everything in 15 and in one Clausing, while whatever that something like that it will be just horrible. But using classes, you know, you can have a class for morning toe or you can have a class for a keyboard. You can have a cost for the printing device and other things like that. And then when you want to change something, going to want to look for something is gonna be just a Z and is it fine, right? That's why it's so cool. So the cool thing about it is also that I can create another monitor so I can create another type of Arabia which will be called monitor, for example, monitor to and create a new monitor. And now I can type something like monitor to and change the wave to, for example, 20 thousands and off course. When I use the monitor to get with matted, which is executing this thing here, right? It's like, Hey, I'm gonna jump from here, took him and execute this code here. So, balm, as you can see, the 20 thousands and I type here and well, I can, for example, invoke first this than this. We have two different instances. We have got to different copies of objects. That's the coffin. Great concrete men and different monitors. This is just a blueprint. This is just a form for creating instances, right? Lo brains, maybe, maybe even better work. And you might be like, Hey, this is very tea or eat a cow example. Yes, it's kind eyes, but it's easy to understand it then. But Okay. We've been already using classes. We created something go, this called strength. And if we tied, for example, name you will not. Is that inside of it? We have good access to many, Matt. Its many functions that can do something with that value like that with the sequence of characters. Right. So, Aiken, type something name dot and now I can, for example, check what is the character of the position for right? And we can send this to the output so we can dio we can do something like that. Easy, right? And it's the so their man emitted that you can use inside of it. You should also notice that you should name your classes with the big letter. Okay? With the upper case at the beginning. And you should name matters with the small letters that this start. Why? Because then it's easy to, you know, see what's what in your program, right, You can instantly see Hey, this system is really an object, right? And it's true when I types system that I can access some methods here and some properties, right? That's very cool, Onda. Well, when something is starting with the small that there is gonna be a property or it's gonna be and met it, right, So it is very useful toe name to use the convention of naming your classes like that. You have also probably notice now that finally, we understand what's going on in our program here we have got the clouds right, And this classes public class. What does it mean to this public it This means that it's available everywhere because, hey, here we have got the package package means that we have got everything sorted in one place , like, for example, the classes. And when I create another class year So when I do something like that, as you can see, we have good. We can have many classes. They're owning the same package right in this package here and well, you can have your own packages and there are many other packages created by other people by , for example, creators of Java or other any people. You can find things like that like, for example, frameworks on the Internet and you can import these packages here using the import keyword right. And your package can be also important. How to do talk about the next lessons by, But you can import them. And when you are used to think the here something like that, it means that it cannot be imported. Okay, when you don't at public, it means that this glass is gonna be on leave able to this package of you create another package. So, for example, like that, and you create hearing sight and other class and you would like toa act us things from here , it would not be just possible. Okay, if there is no public behind the class, but if there is public means that's available everywhere, the same goes for the public here, Okay? It means that it can be accessed from anywhere. Well, I will talk about those so static. It means that it's available all the time method. Okay, Andi. So it means that it's even available when you didn't create your class. So that's why it's the static is need before the main because main mattered. As I said in the first lessons is the method that is gonna be executed as the first thing when you play your program, right. So it needs to just exist at the start so we can execute all the instructions here and well , he was a world called Void, which means that what is gonna be returned by the main function when he's gonna be executed and void means void, which is nothing. Okay, we'll talk about the returning types and how to invoke met its more in next five lessons. And of course, here are arguments that can be sent to the main matter later and they can be used insight. Um, these method right the same for this change brightness, we can send your something and change. For example, this thing well, we will improve our skills, our abilities in writing things like that in the future. Well and both 10 lessons. So this very long, but also very important topping in orderto understand anything in Java. Okay, if you understand this part of programming well, programming anything in Java is gonna be just easy. Okay? So keep with me. And if you have any questions, just feel free to ask. I am always here to help you, but records 30. Constructors: Hello Today I will tell you what our constructors and how to use them in order to show it our create a class that Wilko appoint. So point is a class and the class can be represented by properties. What properties are representing the poor? Well, it's coordinates right x and y. So let's create properties like that X in X and and why? Okay, so now we want toe create the point. In order to create a point, we type new keywords which will reserve in our random actors memory that place for our new object that we gonna create for the copy of object for the instance of the object. Okay. And we have to type the name off the class and then parentheses dead are invoking the constructor. Okay, this parentis is with the name off. The cost is invoking the constructor, the default construct. And now we created something in our memory. But well, we didn't create a reference for this thinking, right? We didn't save it in the world. So we'll be just did it. It also and something. So we should save it summer. So we should create a place where we could story so yeah, we have to create a variable ever able with will be called this time an object. So we have to type a type of are able what type of the object we want to create and we pour Call it point and for example let's call it well, people. And that's a sign this into this. Right? So now we have got the raft friends. Now we have got something in the memorial where we can point to So this thing is called involving vocation off that default instruct constructor and you assign it to the variable with this P Right now there's an object now and we can get to the X and set, for example, the values there and later we can show it to the output. And well, as you can see, it works fine. But what would happen if I wanted to? Xiang's the values, the coordinates using the constructor Because what constructor means it's gonna construct something the way you want to construct. If you have to do something like that each time, right? Imagine something like that Bomb, bomb and not be too. Be free and then now hear different values, right It's just horrible. Called You have to do lots off lots of counting like that. And now imagine that you have got, you know, more properties like 50 of them, right? It's good idea to keep everything simple and close. So it's good idea to keep everything in one constructor. Did you gonna create on your own? Let's create a construct. In order to create a constructor, you type the name of the class you want to create constructor for than the parent disease and this curly braces Okay. And this is the default instruction. And I mean constructor that a that was involved here. OK, so this thing is done automatically, as you can see, nothing Question. But if we do something like that, this is default Constructor. You will notice that Yeah, this is the thing that was involved and default in constructors are used to, you know, set some default values. So, for example, let's say that I want to have default values. Ah, 101 100. As you can see here we have 10 and 20. But it's because of this to Lynskey. When we delete them. As you can see, it's 101 100. So we said the default values when we delayed it, it 00 default values for the integer inside the class is just 00 Okay, But even to change the default behavior, you can use the default constructor. But if you want toe, create something more, right? Do you want to go? For example, sent here, for example 10 and 20. You need to create another constructor with parameters. So you gonna declare he, for example, first parameter and then the second parameter and well, right now is you can see we don't have errors. And we didn't see also the method disease. The default constructor is because this constructor was executed. And now we sent here in the line 17 10 and 20. They were assigned to these vory variables here. So too the first and the second variables. And we cannot ascend these values to the values of actual object so we can type something like eggs equals first. Why equals second? And now when I run this program, as you can see, it's 10 and 20. So now when we want to create another point, we just need to do something like that, right? P two and then, for example, four and 25 right? And now we just to copy these things. So bomb and feet, too. And as you can see, it's working fine. So constructors allows you to do thinks that are constructing the object once, right? You don't need to copy your coat. So because off it, if you had, for example, some conditions here, here, write many instructions you wouldn't need to copied. Each time you you wanted to create another object, right? This is the place for constructions conditions, for example, a far these lower than 100. Then I want to change the 1st 2 for example, um, 150 right? That's why we would notice that we have gotten now both times 150. So it's like, Hey, if the first is lower than minimum requirement, right, so we could stops on the minimum requirement 100. Then you have to, uh, changing toe 150 right? So you, you know, get it. If if not the constructor, you need to make for each object something like that. And if you wanted to change them something inside the cold like that, you would need to changing every place to use it. That's why constructors are also right. Right. Okay. So to sum up, constructors are constructing object. That's only did Listen, thank you very much. 31. this keyword: Hello Today I will tell you about a key word that is called this in the last lesson, we did something like that with constructors. But look, this thing here is no the self, the script Evening. 1st 2nd Really? Maybe we could call it X still. And why to then? Oh, yeah, Maybe it's getting better, but the truth is that it is just no sense toe. Create a new name for it. It will be best if we could do something like that right now it looks 10 times better. The problem is that computer doesn't know. Now if we think about these six or the X that was sent here, right, the 10 here was sent bomb to this place. We assigned this stand to dig his ex on. Then a we'd run his wheat and you can exactly tell the compartment which one You want to act it by using this cure? Okay. When you do something like that, you say that you want to exactly actors this element, so you if you have a conflict of names, then you should use that this keyword in orderto exactly say that you want to access the current value off object. Okay, so this in the city, in the situation like, for example, in the line 17 it would be like P that X right p dot Greg equals the X that was sent here. Why Did was send him so. But in the light 18th it will be Peter. Peter. Okay, so this is gonna be replaced by this. It really depends on the situation. Where you gonna involved, Right? Um, I liked. Also add the these variables are court parameters. OK, parameters and values that are sent to the constructors are called arguments. Okay, So here are temporary variables that are called parameters, and you need to know by temporary that I mean that they are deleted after this kind of brace. Okay, So these values that are sent you 10 and 20 our local copies for this Bolden off constructor. And after the the ending covered brace, sir, they stop existing. Okay, the selling that lesson. Thank you very much. 32. Methods: Hello, my friend. Today I will tell you what are met its functions, how to create in and why do they need it? Function is simply a block of coat which can be invoked executed as many times as you want in different places in our code by us or even other people. So far, we've been using something like that. Look, when we do stuff like that system that out that print line. As you can see, we have got human versions and off print line and we can send for example string right, you consensus like test and we can see the message. So there is a block of cold summer. There did. We are executing And the cool thing about methods is that you can now simply do something like that and everything is still gonna work right? We're executing the same code each time. And now if somebody who created the print line method, I would like to improve it, for example, he just invented a new algorithm for so it will work faster. Right? Then he will just change it there and we will see the result here with without using something would would be called a method he would need to say to everybody Hey, you know, you have to know change your called in order to make it faster. This will be crazy, right? For I just cannot imagine working without something. Will this called methods? Okay, so let's create a sample cost recall test and we learned the syntax in this lesson. So this will be a theoretical examples, okay, Off methods. So you will know them very well in future will, right, Some better methods. But before we go into writing it, I like to tell you that some people might have problem with me because I'm calling function methods and meta dysfunctions because well, in other languages, oh, functions are outside of classes and things that are inside classes are called medicine. That's the only difference that's proving. This is that in Java there is just no difference because there is just one type, right? Everything is inside the class, so you can call of them all of the matters. But if you call them functions, nothing wrong Well happen, OK, when you look at the name function these cold like that because as the name suggests, it's taking a role function of doing something right. And what is the matter? Because it's a matter for resolving the problem, for example, So methods can be used, for example, for printing something out. It can be used to get something from the import from the forms, or it can be used to calculate something. Right. Okay, let's go back to how to create and that in order to create a method first, you need to type what is gonna be returned by the matter right now. We don't know what does even return means So will return laughing Res void, right? Void means something empted. Something like emptiness. Right means nothing. So we're gonna return void, nothing. And now we need to call our method. It should be self descriptive right now. Let's go. It, for example, Praying something out. Okay. Our method right now is gonna just print something out. Okay, so let's do it. Something out. So now we want to invoke a mental like that in order to do it first willing to create and instance off the cast right wing to create an object, and we could need to store it somewhere. So let's create a variable off type test. Let's go eat, for example, A And let's now reserve in our memory using the default test Constructor that place and saving doing right. And now we can print, as you can see using. There's something out. Yeah, it works pretty fine, right? We printed this thing out. Okay, so that's no Maggie, the Big Carter. What if I wanted toe bring not something out but water? If I wanted to bring my name and Starling Oh, then I showed it's create a place where we can start these values inside is method temporary. So we need to create it. Power matters, right? So for example, Sprink and now name String on. Sorry. And now, as you can see, the I d. Says that that something is wrong because there are no arguments we didn't send any. Think you. Okay, so now we can send them, for example, my name and my Suning. And now we can print this thing out so we can do stuff like name and this paste Plus, for example. Certainly as you can see now it works are Egg Budaj. The cool thing is that I can very fast bring many things more, more, More than one thing grind on another coughing. Is that if I, you know, did like I know 1000 times in different places of our code imagined that the we have got many classes and we use this print something out method many times. Mm. And for example, I'd like to add enter right. I would like to at also information like name like that. And the cool thing is, now, as you can see, we're going to do it in one place. Look, we are doing it in the function. We're just changing it only in one place. And as you can see, it's been changed everywhere, right in every place where we executed this code. Because every time when we do something like that, we execute the coat here, and that's the reason we are using Also matters, right? You changing one place, and it's gonna be changed in every possible other places where the method was invoked. So invoking the function means using this parentheses after the name of the method, and you can sometimes send arguments and the place where you involved omitted is gonna be replaced by the return. Think right now, is replaced by voice. So by enough, but sometimes you want to, for example, do something life, for example, adding two numbers how to do it. But then I type first the type off thing that I want to return. So in our situation, let's say it's in Teacher. So we gonna, for example, at two numbers. So at we'll be the name of our method. And now let's create parameters here. So, for example, into dry in teacher why? And as you can see, the I. D. Says, Hey, you are missing the return state and you have to return something. OK, so let's return. For example five. What will happen when we do something like that? Uh, A at 100 and for example, 500. What we happened. Second thing. Nothing happens because the thing that was returned the five he's right now here like that . Okay, it's just simply here standing and it was not assigned in the world. So we have to assign it. We have to creative a rebel. That will be the type of the return variable here. So, for example, in teacher and whatever and the same the at here, right, that's going Maybe result. OK, did this will be better served the script, his name. Let's send it to the output and as you can see now have good as there is old fight. Okay, so it works. We returned fight, but we want to return the some off this, I think. Oh, so we just need to do something like a plus. Why write only be Let's go eat aches and why 600 when you change something here, Free counter and 20. So as you can see, you can return something right Pretty easy. Okay, Lets train a bit and that's create divi Ah, um edited with divide two variables. So we need double right now because it can have a fraction. The result can be a fraction the right. And now we call these, for example, Divide in the end. Why? Because you can see I can name for Ebel's the same in another method. It's because these are local very booth, which means they are destroyed after the scared abrasive. As I said in the last lesson, Well, because as you can also a zika probable some notice the method is looking very similar to construct er the constructor is really met it. But that method is not returning anything. It's just constructing the object. And then you can saying that object to, for example, of a rebel like that, right? So OK, let's of course, these will be doubled volleys. Now let's divide them. So do something like that. And now we're here. Divide, um, and off course. You need to return it to the same type. And as you can see, the result is 0.4 500. The result is okay. But what will happen if we type here, for example? Zero. As you can see, we have got here a message. Infinity. It's because you cannot divide by zero. And the truth is, the double is, um really when you're using it, it has got something. What is called the rapper. They're all power, something that on and it's used. It's doing something like, you know, it has good methods. When you do something like that, double A. As you can see, I created it with the big number. As you can see, there are management IDs inside the claws like that. But what? Maybe not. Let's not go into this topic right now. But what as we have got the result infinity here. And we could, you know, check before, For example, if why equals zero, Then I want to return for example. Zero. Okay, I want to decide to. So so something like that happen. And as you can see now, we have with zero because these instruction was not executed. Okay, you could also You know what? Let's do something like that test. As you can see, instructions below the return are not gonna be executed. Because when compilers sees the returns instruction, it's gonna return, right. It's gonna job return to the place where the method was involved. So here, and he's gonna replace this by the thing that was a polite. So in our situation, it's zero. And because zero is really know, the double is gonna be changed. So 0.0, because this is available. It is a thing with a fraction with zero right now, but, you know, it's maybe a bit complicated, but, hey, that's how we'd work. So that's how you create very simple methods. And as I said, they are very useful because your code becomes clear. Everything is in one place. When you look at the name off method, you can instantly sit see what it's gonna do, and you should remember to keep methods and properties that are, you know, using, for example, also met it, sometimes inside classes that will be connected to each other. Right? You shouldn't create a class like I created here that, you know, do something. I bring something out at divide. Well, maybe. Well, it could be called math class or something like that. And But, you know, you have to keep everything connected. The one t meth. Okay, Everything must be created in dead way, so it's easier for future usage. We'll talk lots off more about me