Summary
Keywords
Full Transcript
Hi everyone and welcome to our college and in this video we are going to start with our Java course We have divided this course into two parts which is the first part of the introduction to programming We use Java and what is the coding programming and what is the learning of it The fundamental thing is that we learn Java to understand and understand it And in the second part we learn data structures and algorithms So the programming of our plan will be introduced in the first class which we will learn today What is the code, how are the coding? We will install our code editors in the next class input, output variables and data types And in this way we will cover some topics in the next 12 days So Java will learn with our Shandhar course If we want to talk to someone in real life then we give them a set of instructions Which we will give to a language teacher As I am talking to you, I am talking in Hindi language We can talk in English but if we want to work with a computer or laptop or mobile then we have to tell them Now English is not understood by Hindi, it is understood by binary That is 0 and 1 Why is this 0 and 1? Because our laptop and computer are electrical devices which run from the middle So when we represent the circuit, we can represent it with one And when we don't represent the circuit with one, we can represent it with zero Or when we detect the devices high voltage, we can represent it with plus one Or when we are detecting low voltage, we can represent it with zero So in this way, we can represent the real life decimal numbers And we can represent 0 with zero in binary And we can represent 1 with one in binary And we can represent 3 with one in binary And we can represent 4 with one in binary And we will move ahead from this way Like this A, B, C, D, E, F, G Or special characters, whatever the things we have, we can understand the computer in the combination of 0 and 1 Now if you want to make a thing in your mind, it is very complicated If you want to add 2 numbers to the number, like 53 plus 72 Then it will take a lot of time to convert it into 0 and 1 So I have told you that here our high level languages help us How? In this course, we will learn the high level language of the language So in the language, we write our code And in the computer, we have a compiler that converts it into a binary format Which is used to understand the computer And here we start our coding journey So you have learnt to talk But we have to give some set of instructions To give these instructions, we have to program So we will use Java language code to give commands or instructions to the computer to perform something Now if you are not understanding the things, then let us take an example Now in day to day life, if we want to execute some work, then for that we have to give some set of instructions Like we will understand it from a flow chart Like before, I will start with some raw material like maggi, masala and water With that, we have to cook a barathan and a stove Next step is to add the maggi in the barathan and cook it after that Let us boil it and check what our maggi is If the maggi is not ready, then we say to boil more And if the maggi is ready, then let us turn off the gas Then we serve the maggi and eat it Then we have to exit from our flow chart Similarly, when we want to explain to the computer, then we use such set of instructions Before we write them in the code, we will see how they will be explained in the flow chart We will find out in real life how similar our communication is And we will write the same set of instructions in the computer science language We will say pseudo code Now what we have to do is, we have to take two numbers from someone And calculate their sum and print it How we will represent the same logic from the flow chart We will start first, so we will draw our start After that, for input, we will take our variables to input First, we will store the variable in number 1 and then we will store the variable in number 2 In other words, we have taken the input from the user in number 1 and number 2 After that, we will store the variable in the sum name In other words, in number 1 plus number 2, we added and added it After that, we will print our sum and finally we will exit So, in this way, the flow that we have to do is the work Similarly, if we talk about pseudo code, then what is the first step in pseudo code?
We are starting After that, we are taking the input and then we calculate the sum In number 1 plus number 2, we are printing the sum and finally we will exit from our code So, the flow in pseudo code is the way we represent the simple language in English And we convert the same pseudo code into actual Java or C++ or Python code Now, to write our code, we have to install some things in Java The first thing we have to install is the Java Java Development Kit This is the kit that contains all the things that you need to run Java for your system Whenever you have to write the code, the program you need to write And if you want to run it on any system, then we need to get some necessary tools to get Java Development Kit Along with that, we need to download the code editor or IDE, that is, Integrated Development Environment This can be any of the things that we use in our course, Visual Studio Code or VS Code You can also use IntelliJay or Eclipse These are some software, like we are downloading games for games We need to download a software for the code, on our laptop or computer After downloading these software, we are writing our code on them And we are showing them to us that what is our actual result output Now, we have already made two videos, in English and Hindi, to download the VS Code The first video that you will be seeing in the C++ series is in the first video We have downloaded the C++ and showed you the compilers of C++ We don't need to download all of them, we just need to download the Java Development Kit Along with that, we need to use Visual Studio Code Now, whether you are working on Windows or Mac, these are both sufficient to download You can refer to these two videos Along with that, if you want to download IntelliJay, then we have already made a video In the Java One Shot, when you go to Java One Shot, you will get a complete installation process How to download Java Development Kit and how to download IntelliJay? Along with that, we also show you that, as you go to your Chrome So, all the browsers that you use, go to them and search for Java Development Kit And in this way, the first link of the Oracle will be available You will go to them, so you will get different formats to download If you are working on Linux, you can download it from them, if you are working on Windows So, you can download the Java Development Kit from your system And if you are working on Mac, then this is your link So, in this way, you download the Java Development Kit, download it with the same editor Apart from that, there is another option, which is available in the entire Java developer pack So, what Microsoft has done? We have got some extensions with Visual Studio Code Java Development Kit So, in this way, you will get all the things to download in one link So, for that, we will search Visual Studio Code Installer Pack Java So, here the first link will be available in the Java In Visual Studio Code We have to scroll a little bit inside it and this is installing the coding pack for Java Windows So, if you use Windows, then you can install the coding pack for Java Mac OS if you use Mac So, in this way, you can set the Visual Studio Code on your system And the next code we will write with the Java, we will write it on the same code editor Now, if we download the code editor, then we will see the visual studio Code in this way So, in this way, we will create a new file So, you can create a new file, after creating a new file, we will write in this file, our first Java Code Now, before writing this code, we will talk about the first two classes of the beginning The code we are writing, if you are looking at the first time in the coding, then you can not understand a little bit But, we do not want to listen to a lot, we want to understand things If we learn French in the beginning, then we will learn a lot of things and we will not understand But after a little while, we will understand the things, then we will have to see the faith of the code So, we will start understanding the code when we see the code So, we will start understanding the things, so, in the first class, we will write the code, we will not understand a little bit We will not understand a lot of things, we will understand them, so, we need to understand those things First of all, in the first Java code, we will write, we will create a class So, in the first class, we will get the name of the class, we have given the name of the class If we create a public static void main name function, which will be the string argument So, in some way, Java has no template to write a code In which you define a class and you define a function Now, what is the function of a class and what is the function of a class, we will understand a little bit later But, let us now consider that whenever we want to write a code, we have to do this And, what will the file be doing to save? Whatever you have given in the file of the Java, we will give the name of the file The first class, we will save the file of our Java as firstclass.java So, the file we save in Java is the name of the dot Java Like, in the 11th class, whenever we read the computer science, we would save the text file from the text file So, all the files we save from the dot Java, we have done this So, in this way, the color coding is coming on our text editor Where you will be able to see some different colors You will be able to know the time difference between different colors So, we have understood that this is something template to write a Java code Now, the first thing that usually writes all the programming languages in the code, is the Hello world In which, you are saying the first time the world is using its programming language So, let us write it System.out.println Hello world Now, we will run this code.
After running, you will know that what happens with the actual code? What does the Java code mean? We saved this in our file in some line Now, click on the right and run and run So, for us, something like this will print Hello world We can understand the code in which we see that many code is written in the code And then, what is the output? It is a website that we see By the way, the Java code we wrote here is because of this, we started to see this Hello world So, this is something that is in the code In which, you can see something in the code's help Now, we are going to show this code on the screen You can get any data from your code from the user Input.
We are going to explain it in the next classes Now, we have understood that the code runs in this way And we show an output Now, let us understand that how does the Java code actually run? To run the Java code, the code runs through two steps The first step is compilation and the second step is execution Now, this theory is a little important because the theory will never be asked in your placement interview Or, if you are in your college, you will be able to get the subject there Now, the Java development kit we have downloaded That is, JDK This is the name of the JRE component We call it Java runtime environment With the JRE, there are a lot of development tools available And this JRE is also more component than JVM JVM means Java virtual machine So, Java virtual machine JRE and JDK are one in one level wise form And the whole Java code is run by the help of this Now, if we understand both the stages So, what is the compilation stage? The code we write is called source code We save the source code from the Java And this entire code goes to a compiler This compiler is inside JDK And this compiler has all the source code And this compiler is converted to source code into byte code Which is extension of dot class And this byte code can run on any operating system As long as the Java runtime environment is in the operating system So, if you have written the code in Linux, Windows, Mac, OS You can convert the code into byte code and run it on any operating system You can't do this with C++ That is why Java is called a portable language Because in this, you convert the apps into byte code and run it on any operating system So, this is the first stage covered by the compilation stage Now, if we talk about the second stage What is the execution stage? The byte code we had with us Now, Java is using the virtual machine in this byte code And it converts it into native code It is called native code The code we have understood is the lowest level code we have understood It comes to zero or one The native code is the same as the code we have understood in the machine Now, when the byte code is converted into native code So, if your machine is Windows or Mac Now, your Java code will be understood in the same way As you had to print a hello world So, your machine has converted into native code And then, your system has started to show you a hello world Now, if we talk about the components of the code The first component of this is function Functions or methods are part of the code Which we perform something to perform As if we had to add two numbers So, we write all the codes in the function If we had to print a hello world So, we write all the codes in the function And what was the function?
The function was the void main name The main name of the function was the main And the return type was void It was empty This function did not return So, we just printed a hello world for our own So, we write all the codes in the function And we write all the functions in the class So, the class is a big entity Which can be found in many functions How to explain the class? As our kitchen is big And there are many small dubs Which are stored in the kitchen Like a kitchen has a kitchen And a kitchen has a kitchen So, the class is a small function Which is a small function There is some work in one function There is some other work in the other function And the main name of the class in the class It is the first part of the code Which is executed So, the first thing in the main function First of all, we have to execute all the codes And then we have to execute them So, today we have tried many things And we have tried to understand what is the code And what is the coding How do we understand the machine? And how do we actually write our Java code? I hope that you will download the code editor Or visual studio code Or whatever you like the editor And you will download the code with Java development So that in the next class We can write the code with the class And see that we are not having any problems Or we can learn all the things And we can do it Because in coding, practice is more important So, the more we practice The more we can understand the code Today we will meet in the next video Till then keep learning and keep practicing
