Transcript for:
Java Programming Session Overview

all right so as part of today's session we're  going to start Java programming so in the today's   session we will see uh what is Java and some  Basics like uh what is objectoriented programming   and uh then we will see how we can install eclipse  and Java and we will set up the environment and   then we will start okay so that is the agenda for  today's session so the first thing uh what is uh Java and if you have any queries use chart  box at the end of the session I can unmute   and I can ask all the questions okay so first  let us start with what is uh Java so Java is   basically called as objectoriented programming  language object oriented programming language   so this is the definition so what is Java Java is  a objectoriented programming language so what is   objectoriented programming language normally there  are three kinds of programming languages which we   have in the market one is object structure  oriented programming languages object based   programming languages object oriented programming  languages these are the three categories of   languages which we have in market so let me just  put here there are three kinds of programming   languages structured of object based object  oriented so structur programming languages example   C and python so these languages support structure  oriented programming and VB VB script python will   support object based uh object based programming  languages like python will also support everything   like structured object based objectoriented  everything and when you come to objectoriented   C++ Java C and python so these are the examples  of object Orient oriented programming language but   on what basis we will divide like this structure  object based object oriented so for example when   I say A programming a language is objectoriented  programming language on what basis we can say a   language is object oriented on what basis we can  say a programming language is object based and   structure based so if any programming language if  any programming language support object oriented   programming Concepts there are certain number of  concepts are there and if any programming language   will support those Concepts we call them as a  objectoriented programming language for example   uh let us say I have six different concepts  we call them as a objectoriented programming   Concepts in shortcut we can call them as a poops  objectoriented programming system Concepts class   object polymorphism inheritance abstraction  and encaps so these six concepts are called   objectoriented programming Concepts right so  if any programming language supports all these   features all six features class object  polymorphism inheritance abstraction and   capsul everything then we can call them as object  oriented programming languages so those languages   will support all this objectoriented programming  Concepts and they call them as a objectoriented   programming languages so Java will support  all these Concepts so that we can call it is   a objectoriented programming language then what  is object based so in object based programming   languages which will support only class and object  it will support only class and object rest of the   features are not supported so rest of the features  are not supported so those type of programming   languages are called OB object based programming  languages so VB VB script these are all object   based programming languages python also will  support class and object python will come in every   category like we can do structure programming  object based programming object oriented   programming everything we can do using python okay  now what is structured programming language so   structured programming languages doesn't support  any of these Concepts you can still write a   programs but they don't support all these Concepts  class object polymorphism inheritance abstraction   and encapsulation so these concepts are not  supported in structured programming languages   and ex uh except this Python language python comes  under every category but other than this python   rest of the languages if I look at C language  this is purely structure oriented programming   language similarly if you look at VB and VB skip  these are purely object based oriented program   programming languages object based programming  languages so that it will support only class and   object and object oriented mean it will support  all six Concepts like C++ Java C and these are   all purely objectoriented programming languages  and python is also objectoriented programming   language so python is allrounder which comes under  every categories we can do structure programming   without using class and object also we can write  a programming by using class and object we can   do but we can also use other Concepts other  objectoriented programming Concepts in Python   so this is a basic categorization okay so what is  objectoriented programming what is the definition   is as per definition Java is a objectoriented  programming language why it is objectoriented   programming language because which will support  all objectoriented programming Concepts which   will support all types of programming all types  of object oriented programming Concepts so that is   the reason we call it as a purely objectoriented  purely objectoriented means what again so without   class we can't write a single line of code in  Java without class we cannot write a single   line of code in Java so which is purely object  oriented programming language but when you see   when you look at C++ or python or cop they are not  purely they are object oriented but with without   using class without creating class also we can  write a program so Java is purely objectoriented   programming language because without creating  the class we cannot write a single line of   the code in Java so that we can call it as a  object oriented programming language okay so   now you have understood what is objectoriented  programming language if any language supports   these six objectoriented programming features  those type of languages called as objectoriented   programming languages so later we will try to  understand all these features and we are going   to learn all these feature from Java programming  okay so these are all objectoriented programming   Concepts class object polymorphism inheritance  abstraction and then encapsulation so Java will   support all these features so that we can call it  as a purely objectoriented programming language   now what are the different features are there for  Java what are the different features of java what   it will support what it will not support there are  mainly two features we can discuss one is platform   independent this is one of the most important  feature from java platform independent so what   is platform independent means platform independent  means we can install Java on any type of operating   system it will support Windows it will support  Mac it will support Unix it will support Linux   almost every operating system it will support  that's the one thing second thing is if you   write your Java program on Windows the same Java  program we can execute on other operating systems   so you don't need to change the code from one  operating system to another operating system   you don't need to change anything the same piece  of code whatever you have return the same program   you can easily execute on different platforms  without doing any change so that particular   feature is called platform independent platform  independent means what we can execute the same   Java program if you write somewhere and if you  write a program in one environment same program   you can execute in different type of anys so that  is called platform independent feature these are   one of the most popular popular and important  feature from java a second feature is Java is   case sensitive language K sensitive language this  is another feature of java so K sensitive means   what it will differentiate lower and uppercase  characters it will consider lower and uppercase   characters differently which is basically called  as case sensitive language suppose if you write   something suppose I create some variable called x  equal to 10 and uh this is one character suppose   if we create one more x equal to 10 so here  the x is small case and here x is uppercase   both will be treated differently that is called  Cas sensitive language and if you look at some   other languages like python or other languages  they're not K sensitive languages especially   when you look at VB or VB script they are not K  sensitive language means what you can write uh   code either in uppercase characters or either in  small case characters will be treated different   will be treated same but in Java it's not like  that so the Java programming is Cas sensitive   Java language is case sensitive so lower case and  uppercase characters will be treated differently   so that you need to remember so these are the main  two important features platform independent and uh   Java is a k sensitive language okay now in Java  normally we heard three different type of terms   jdk JRE and jvm so these are three important  components which we have to understand from   jav components and interal perspective these  are most important so please remember this   three components and somewhere in the Internet  you may see these particular terms one is jdk   second one is JRE and the third is jvn so these  are three different inner components of java   jdk Java development kit the full form is Java  development H JRE means Java runtime Java runtime environment and third jvm means Java virtual  Java virtual machine so these are the three   different components which we have in Java jdk  JRE and jvm so let us try to understand this for   interior prospective this is most important what  is jdk JRE and jvm jdk means is a Java development   kit this is full-fledged Java software suppose if  you want to download Java software from internet   you have to download jdk so you don't see Java  download anywhere else you can see jdk so jdk   is representing full-fledged the complete Java  software which we have to download and install   jdk means what Java development kit so if you  want to write your Java programs or if you want   to execute it or if you want to develop any Java  based applications we have to download and install   jdk Java development kit the full software is  required so so whenever you want to develop   any Java based applications you have to download  and install jdk that's the first component this   full software now second is JRE Java runtime  environment so sometimes Suppose there is some   application which is already developed using  Java itself which is already developed now I   want to download that application I want to  install that application in your local system   right I want to download and install install Java  based application which is already developed by   somebody else so to install that application to  run that application you need to provide certain   environment that is called JRE so for example uh  somebody is developed a Java application which   is already there internet you have downloaded some  executable file or something and before installing   that software you have to install JRE you have to  provide Java runtime environment and once you have   Java runtime environment then you can install that  particular software and you can run it and here   you are not developing the software you are just  installing the software which is already developed   by somebody else so to run that particular Java  software the software which is developed by using   Java if you want to run that in your local system  you need to install only JRE Java run runtime   environment you don't need to install complete jdk  software just you need to have only JRE component   you can install only JRE that will provide you the  environment on which you can install and run your   Java based applications and if you install jdk by  default you will get JRE you know need to install   JRE separately means JRE is a subset of jdk for  example let us look this is your jdk software and   which contains the JRE itself so if we install jdk  Java development kit by default you will get JRE   along with the jdk and if you want to develop  any software any Java based application anyway   you have to install jdk along with you will  by default get J it is a sub component of jdk   suppose I don't want to develop any applications  I just want to run my Java application somebody's   developed and I have just want to install it  and I want to run that application then you   can install only JRE separately okay you can  install only J part separately this is a sub   component in jdk so these are the two components  one is for developing a Java based applications   another is for running a Java based applications  and if you want to develop the Java applications   you have to install jdk and if you just want to  run the Java based application you don't want to   develop anything then you can just install only  JRE runtime environment now jvm so jvm is a Java   virtual machine Java virtual virtual means what  invisible virtual means invisible Java virtual   machine this is a main component of java this is  a part of JRE jvm it is not a separate or a piece   of software which we can install so by default  the jvn comes along with the J itself but means   if you install jdk you will automatically get  JRE and jvm if you install JRE you will get JRE   and jvm but jvm you cannot install separately jvm  is not a physical software which we can download   and install it is a part of entire Java so Java  virtual machine so what is the main purpose of   this component suppose when you write your Java  program normally we use English language English   statements like a class or in like that so we  will write some Java code like this by using   English statements but machine cannot understand  this so machines cannot understand this English   language so this should be converted into some  other language which can the which the machine   can understand which we can call it as a bite code  okay this this is simple in English language we   will write your Java program but machines cannot  understand this so somebody should convert this   program into bite code so the bite code in the  sense what this code can understandable by any   machines it can be any type of operating systems  so this bite code will be actually executing   internally by Java but who is converting this  somebody should convert this English to bite code   and this bite code will be ex uted internally and  this is platform independent so who is doing this   jbm is doing it so jvm is responsible for many  things jvm is responsible for compiling our code   compiling means what it will check is there any  syntactical errors are there in the program also   so if you write some mistakes or if you do some  mistakes in your right program it will easily   identify and notify you that's the first thing  and once you write your program once you executed   the code converted into bite code the code will  be converted into bite code format and that is   also done by the jvm after converting this bite  code the bite code will be executed and finally   provide the result that is also done by the jvm  so the whole responsibility of java will be taken   care by jvm we can say this is a heart of java so  without having jvm there is no Java so jdk means   what Java de velopment kit this is a full-fledged  Java software JRE means Java runtime environment   which will provide the environment where we can  run our Java based application which is already   developed jvm is Java virtual machine this is a  part of JRE which is responsible for converting   our program or code into bite code format that the  machines can understand and it is also responsible   for compiling our code compilation means what it  will check check whether our code is having some   mistakes or not syntactical errors it will verify  and execute our program and finally provide the   result so these things will be done by the jvm  itself so these are the three main components   which we have to remember from java so jdk JRE  and then jvm jdk means Java development kit Java   runtime environment Java virtual machine virtual  machine means it is a invisible virtual means   invisible it is not a physical software which  is already part of JRE and jtk now which one   we have to download now we want to develop some  application we want to write our Java code we   want to execute our program so which one we have  to which one we need jdk so we have to download   and install jdk which will come along with JRE  as well as jvm guys you are understood now what   is jdk JRE and jbm everyone please confirm in the  chat box so what is the difference between jdk JRE   and jvm most important most popular in question  what is jdk what is JRE what is jvm what are the   difference between jdk JRE and jvm okay now so  which one we have to download now jdk we have   to download jdk means Java development okay now  let us start downloading and setup envirment so   before uh setting up the environment so what are  the things we need so mainly uh Java is having   two we can divide entire Java into two different  parts this is our just logical division uh one   is we can say foure Java the entire Java Concepts  we can divide into two parts foure Java Concepts   and the second is Advanced Java Concepts for Java  Advanced Java Concepts overall the entire thing is   Java only but some Concepts we comes under core  Java we divide them into core Java concept they   are Basics from java and some of the concepts  are Advanced so for example if you look at core   Java under code Java uh we are going to learn the  language fundamentals language fundamental means   what like operators data types conditional  statement variables okay looping statements   concept how to work with the strings and all  objectoriented programming Concepts right so   these are all comes under core Java Concepts  now when you go to Advanced Java so there are   some more advanced concepts like collections data  structures jdbc swing okay these are all Concepts   which are required for development purpose but  as for the testing perspective we don't need   Advanced Java Concepts we can still manage  with the core Java Concepts if you know the   basic objectoriented program programming Concepts  they are more than enough in automation okay so   we are going to learn code Java Concepts all the  concepts in core Java we are going to learn so   before that we have to set up the environment  so to set up environment to write your Java   program to run your Java program so what are the  things we need first thing we have to download   jdk that means what is jdk whenever I say jdk  you have to remember that is your Java software environment setup so there are two softwares  we required one is jdk which is basically Java   software we required to install second is uh id  id means integrated development environment means   there is a software which we need to write you and  run your Java program for example I'm writing some   notes here so to write some notes I'm using  some notepad right and similarly if you want   to write your Java program or if you want to  execute your Java program if you want to see   the result from the Java program you need a kind  of editor a tool or a software that is called as   IDE integrated development environment so eclipse  is a very popular environment especially for Java   so many people will use eclipse and there are  other softwares also there in the market for   example inj ID okay and uh there are so many  soft these are two popular stuff and there are   many more IDs you can use any of the IDS even vs  code editor also you can use for Java but these   are the two popular editors which are there in  the market and eclipse is more popular for Java   developers and Java programming so we have to  first install Java or jdk and the second is we   have to install one ID it can be eclipse or it  can be intellig ID so so initially we will start   with eclipse and once you familiar with Eclipse  after a few sessions I will also introduce how to   install intelligy ID and how to write a program  how to execute and how to use that environment   in intelligy ID so we'll also cover these tool in  the coming sessions but initially we will start   with the eclipse okay how to install eclipse  and we will see how to create a project how to   run the project how to create a Java program  and so on all right so this is these are the   two important softwares which we need to start  with Java okay so first let us start download   and installing jdk but before that we need to  know what are the different versions are there   in jdk what are the different versions are there  in the jdk so if you look at uh versions Java versions from java 8 so Java 1 to8 all these  version or comes from some Micro Systems this   is a company actually some Micro Systems from  java 1 to8 all these versions are comes from   Sun Microsystems and that time Java is available  as a open- source software there is no license   for that after Java 8 from java 9 onwards  Oracle companies acquired Java that means   Oracle companies acquired Sun Microsystems so now  Sun Micro Systems measured into Oracle software   Oracle is a company which is basically developed  the database related softwares we we will know   already Oracle is one of the database which is  popular database which is developed by using   Oracle company right so Oracle is acquired some  micro system is measured into Oracle and then   onwards Java software is comes under Oracle  company so Oracle is owned Java software so   after after Java 9 there are so many versions  are released into Market but as per selenium   standard the basic version which we need to have  is Java 11 so from java 11 onwards whichever the   latest version which we have we can still use  with uh selenium so I can say jdk 11 plus plus   means after jdk 11 from jdk 11 12 13 up to 20th  I think currently 20 or 21 version is currently   going on in the market so whichever version is  available you can use that version any version   is compatible with selenium after jdk 11 so jdk  uh 8 nine and 10 these support is not there so   recently they have announced so the old versions  of java support is not there with selenium so the   latest announcement from selenium guys is jdk  11 onwards we can use any software so jdk 11   plus any version we can use this is preferable  for selenium okay that's the first thing and the   second thing is we can install jdk whichever  version you want after Java 11 and Eclipse we   can always get the latest version whichever the  latest version is available we can get and both   are open source both are open source okay now  first let us start download Java and install it   I will show you step by step and you can just  look at it and after completion of the session   you guys can try this and also I will share the  document which contains all the screenshots step   byep screenshot whatever I'm doing here okay  so I already created one document I will share   this later the version can be anything and the  process is exactly the same and even if you're   working on Mac also the same process there is no  change we have to just download the installer and   start run the installer I will show you how to  download this jdk so first of all you need to   go to uh a Google and just type download jdk  okay once you click on it it will go to Oracle   website Java downloads so this is a web page  and here they provided different versions of   jdk and currently the latest version is jdk  20 is the latest version you can go with the   jdk 11 or whichever version you want 17 is also  fine so if I look at jdk 20 here by default it   is populated and if you scroll down here you can  see three different operating systems Linux Mac   OS and windows and if you're working on Windows  you can just go to Windows here and you can see   three different type of installers and here  you have to download uh executable file.exe   file you can see X 64bit installer so this is  the one you have to download if you're working   on Windows executable file you have to download  and if you want to if you're if you're working on   Mac OS then you can just go to Mac OS and here  you can download DMG this is a uh DMG file you   have to download this is the installer on Mac  OS okay so once you download it uh you will get   executable file or you will get a DMG file if  you are using Mac so once you get an installer   you have to just double click on that installer  it will start installing the Java software so I   already installed on my system so I have just  captured the screenshot I will go through them   you can easily understand and the same process  you have to continue on your system so this is the   link when you click on this here and it will go  to this particular page and one more thing before   downloading this you have to log to this Oracle  website initially you have to sign up to this   account okay you need to sign up sign up means  you have to uh go to this page first of all okay   and Oracle website and it will ask you to create  an account you need to sign up first let me show you it is just Oracle not Cloud okay so here this is a link Oracle create  our your own account so it just go to this page   okay so if you go to this page you have to create  you have to provide all your details can just   provide some dummy details accept this email  address valid email address password so that it   will be very useful for in future also in future  if you want to download any software from this   website you have to login so better to create your  own account in this website and once you created   your own account then uh you can log to this web  page and then you can go to this link directly and   you can downlo download it okay so only once you  login then only it is allowed to download you can   go to jdk 20 or 17 anything is fine okay both are  latest versions right so once you downloaded so   here I have shown you for Java 11 download but  you can try with any other versions no problem   so here I have shown you how to download and uh  once you download can just click on this button   it is downloaded so once you downloaded okay  before downloading it will ask username and   password right so you have to provide this right  so once you get your executable file or DMG file   on your Mac OS just we need to run that installer  just double click and it will automatically start   so it will show you the screen like this preparing  to install and after that you will get this screen   and then click on the next button and then again  it will show you one more window development tools   and source code so you don't need to do anything  here and just remember remember this path which is   most important and this is the default path where  exactly Java will be installed and if you want to   change this path you can change by clicking on  the change button or if you don't want to change   just leave it as it is and then click on the next  button so once you click on the next button then   it will start installation it will take a few  seconds of time to complete this process and   after that you will see this window and you can  simply close this window that's it so this is   simple installation just two to three screens you  can see click on next next next after clicking on   executable F click next next next that's over so  installation is done so once installation is done   we need to set up Java path so this is orle sign  up link okay so once you install Java we need to   set the Java path so which is most important once  you install jdk then we have to set Java path so   this is most important point I'll tell you why  we need to set Java path whenever you install   any new software on your operating system your  operating system will know exactly where that   software is got installed that location of  the software the operating system should know   that so normally what happens is whenever you  install any software on your operating systems   your operating system will remember the location  of those softwares so where it will remember for   example uh if you just go here anywhere let's  say if you're working on Windows you can just   go to uh this PC and go to properties and here  you can see something called Advanced system settings okay properties Advanced system settings and here  this is a where so this is a uh you can go to   environment variables yeah this is the place you  can directly search environment variables you will   get this window so in this environment variables  you can see here system variables so these are   all different variables automatically created by  your Windows operating system so basically what   these variables will refer the different software  so whatever softwares you have installed on your   local system uh it will automatically capture  the locations of those softwares so everything   will be maintained here but in case of java what  happens is whenever you install Java by default   your operating system don't know the location it  will not capture automatically especially for Java   our windows will not automatically capture the  location where it is got installed so we have   to set that path manually other software there  is no problem it will automatically capture the   location you can see here but in case of Java or  jdk we have to copy that path manually we have to   set path here so that is a one additional step we  have to do once you installed Java okay otherwise   we cannot work with the Java so even though if you  have installed successfully it will not work until   unless you specify the path so now what we need  to do is once you install your Java we have to   set Java path so once we install jdk then we have  to set Java path so how to set the Java path so   to set the Java path first we need to capture the  location where exactly the Java is got installed   if I go to C drive this is the default location  program files and here you can see Java so this is   the default location where Java is got installed  so now what we have to do is we have to go inside   this jdk and go to inside this bin folder this is  a complete path this is the complete path of java   till bin folder bin is nothing but a binaries  all Java based binaries are available here you   have to capture this entire path copy this path  and then go to environment variables how to go to   environment variables you can directly search here  can say environment variables can see edit the   system environment variables and you can directly  go here and click on environment variables now   under system variables you can see here under  system variables you can see one path variable   which is already created here path variable you  can select this path variable click on edit and   once you click on edit you can see already there  are some default paths which are already set here   and we should not interrupt them let it be as it  is and we need to just click on new button here   and then paste here whatever path we copied Java  path we just paste it over here that's it so once   you paste it over here then click on okay then  okay and then okay close everything that's it   so this is a way we can simply set Java PA so I  have clearly given all the screenshot here go to   advancer settings and just go to environment  variables and just go to path variable here   click on edit and then just add your Java path  so whichever version you have installed you can   just provide that part till bin folder that's it  so this is how we can simply set Java path and   there is another way to set Java path I will tell  you that also the other way is you can just go to   environment variables directly and here instead  of directly go to path variable you can create   one more additional variable like this Java uncore  home I already created this variable you can see   how to create this can click on the new button  here and say uppercase characters javore home and   here whatever path you captured you don't need to  provide the complete path you can simply provide   only till home path like this program files Java  jdk9 this is home Java home not bin folder so once   you provided your Java home path you can simply  say okay then Java Home Path will be created here   and once you created your Java Home Path after  that go to path variable edit and here you can   specify like this new we already created Java home  right we need to get that path so to get that Java   home path you can say percent Java home which is  already created now and after that we can simply   specify the bin folder slash bin that's that's  it so Java home variable we already created so   we can just refer that variable by using percen  SL bin this is another way of creating Java path   variable or if you don't want to create multiple  variables directly you can specify the path till   bin folder you can directly write it here and  you don't need to create the Java home path in   future it is required but for now it is not  required okay so I already created them so I   just want to remove it so Java home is already  there so this step is mandatory you have to do   and if I don't do this step your Java will not  work your Java program will not be executed so   this step mandator you have to do it and for Mac  users you don't need to set any path by default   if you're using latest Mac versions you don't  need to set any path by default it will get   and it will run it okay you can just check it  so this is how we can simply download install   jdk and then set Java path now what is the next  step so once you have set everything is done so   we have successfully installed Java set Java  path and now we have to cross check everything   is successfully done or not so how we can check  just open the command prompt or terminal like   this and on Windows command prompt or if you're  using Mac you can open the terminal on this you   can just execute one command Java iPhone Java  space iPhone version so if I give this command   this will give you the version which we have  installed so if you're not properly set Java   path it will not give you the version number like  this it will give you the command not found error   okay so if you have successfully done you have  installed Java and also we have said Java part   after that open this command prompt and then check  Java iphon version is executed successfully or not   it will clearly show you which version of java  you have successfully installed okay so like   this we have to install Java and set Java path  and check the command so I have created this   command also we can just check it okay this is a  simple way we can download install jdk so this is   the first thing now so we have success installed  Java which is jdk now we have to install Eclipse   ID Eclipse ID we have to download and install  now let me show you how to download and install   latest version of eclipse always try to take  the latest one they keep doing some changes   every time so try to get the latest Eclipse  so now I'm going to show you how to download   and install Eclipse so go to everything is open  source and free software you don't need to buy   anything you can simply just download and install  okay now go to Google and just download just type   download eclipse and uh you will directly go  to this page Eclipse downloads so this is a   web page eclipse.org downloads so in this page  you can just directly download you can just see   this is the latest version Eclipse ID 20 2309  this is the latest version of uh this Eclipse   ID and uh you can just click on it so once  you click on it it will navigate to another page okay now it will automatically navigate  on and if you're opening this link on Mac OS   it will show you the DMG file you have to just  download it if you're working on Windows it is   executable file.exe and if you're working  on Mac it is a DMG file so this this is   executable file JRE win 64.exe you can simply  click on download and here you don't need any   sign up or sign in anything you can simply  download So once you click on the download   it will start uh downloading the software you  can see here okay the executable file will start downloading so once it is downloaded and just  go to the folder where it is got downloaded   this is executable file now once you get an  executable file we just double click it will   start installing so I'm just double clicking  on this and if you're working on Mac it's the   same process again and just download EMG  file and double click and it will start installing so this will take a few seconds of  time so let's complete so initially once you   start clicking on Eclipse installer here you have  to choose which one we have to install because   there are so many different flavors are there so  you need to select one of the flavors so this is   the one Eclipse ID for Java developers this is  the option which we have to select so once you   click on this and it will show you the location  where exactly it will install program files and   by default eclipse comes along with Java eclipse  is also developed by using Java itself so it needs   Java internally so by default it will get uh Java  like this and installation folder so where it is   going to install it will show you the location  also this is the location and better to copy this   location later it will be useful for creating the  shortcut and you can see create start menu entry   create desk shter leave it as it is and then click  on install and you don't need to change anything   here let it be the default values and once you  click on install it will start installing the software everything is very simple uh very easy  steps you guys can try this and if you have any   confusion just go through the document and  look at the screenshots and then continue in so this will take a few seconds of time  so let's wait for a few seconds okay so once   it is successfully installed you can see one  desktop shortcut is also got created and uh   so now what we can do we can simply close this  window or then you can launch your IDE by using   the shortcut icon or else you can directly  launch from here directly you can simply   click on launch it will automatically launch  your Eclipse so this is the latest version 20239 almost in every month they release  a newer versions so 09 is a latest version okay so first time when you launch your  Eclipse you will see this window and in this   you have to specify the workspace so what is a  workspace so suppose you created some project   and you're are doing some stuff in your project  you have to save all of them in one place you   need to save all of them in one single place  that is called workspace means whatever work   you're doing in Eclipse you have to maintain  that work or you have to save that work in   some place so that is called workspace so that  you need to provide so before before going here   uh let it be there and you can create your  own workspace just go C drive or D drive   wherever you want and I want to create suppose  workspaces I already have one folder workspaces   and here I'm going to create a new workspace  so click on the new folder you can create and   later in future whatever Java programs we writing  automation everything I'm going to store in this   particular folder only so here you can give any  name to the folder so I'm just giving here let's   say 15th so 15th September bch September 2023  batch so I'm just giving some folder name here   and I'm using this folder as a workspace so once  you created it now come back and here just you   need to browse it click on browse and uh then  go wherever you create a workspace and this is   only one time task once you created a workspace  you have to use the same workspace forever so   I'm just selecting whatever empty folder I have  created simply select folder so now you got the   workspace okay and then you can select this  box if you want use this as a default and do   not ask again so every time when you launch your  Eclipse it will ask you to specify the workspace   location so if you don't want to ask every  time so you can simply select this checkbox   and then click on launch so once you have done  it your Eclipse will start opening the workspace okay now first time when you open your Eclipse  you will see this window and uh this is a welcome   window and if you don't want to see this welcome  window every time uh you can simply directly close   it or you can say always show welcome at start if  you select this checkbox every time the welcome   window will appear we don't need this every  time so we can simply close directly okay now   this is a new or fresh window of eclipse this is  a default Eclipse Window first time you will see   like this so now we need to do some things here  so you don't need here task list you can just   close and outline also you can directly close  and the problems all those things you don't   need you can simply close this declarations  and everything so this is a plain window and   here you can see by default package Explorer and  this is the most important window and uh there   are some menus are there some icons are there  later we will try to understand one by one so   first thing what you need to do is whenever you  open your Eclipse by default you can see your workspace okay you can see your workspace here on  the tab title tab you can see your workspace can   you see here 15th September 2023 batch Ian Eclipse  ID so this is your workspace name you will see by   default you are already in your workspace so  now what we need to do is we have to create a   new project so whatever prerequisits we want we  already done it so jdk already installed Eclipse   ID is already installed so now we are ready to  create a new Java project and we are ready to   write a new Java program and we are ready to  execute it so now let us do step by step so   the first thing is we have to create a new Java  project once eclipse is ready then we have to do   some steps so first step is we have to create a  new Java project in Eclipse only one time so same   project we are going to use in every day so first  we need to start creating a new Java project so   how to create a new Java project in Eclipse you  can directly click on this create a Java project   link from package Explorer this will open a new  window like this or you can just directly go to   file menu here you can do new and Java project  and this will also open the same window or you can   directly use this icon can see here there is icon  click on this icon can click on the Java project   so this will open the same window so once you open  this window here you can provide your project name   so here I'm just providing some name say Java  programing you can provide any name to this don't   give any spaces and everything just provide  some project name so once you provided your   project Name by default it will take whichever  Java is already installed on your local system   or sometimes it will take Java from Eclipse itself  because Eclipse also comes along with Java so by   default it will take so no need to change change  anything here just to provide only Java project   name simply you can create finish okay just say  only finish so once you click on this finish then   it will create new Java project you can see here  okay this is a new Java project which is showing   under this Java project by default you can see  Jr system Library means what this Java project is   associated with jav itself and under this SRC you  can see something called module info. Java so I   think we we are not going to use this modu concept  you can just have it or you can just remove it no   problem you can just say right click and then  I can delete this model info. Java we don't you   can say delete it so now this is a simple new  Java project which we have to create this is a   step number one so once you created your new Java  project so then what we have to do is we have to   create a new Java project new Java package in the  later uh upcoming sessions I will detail explain   about what is package all those things but for now  just follow as it is create a new Java pro package   so as soon as you created your Java project inside  this SRC SRC means what source it is a main folder   or we can say main package in Java and whatever  we are going to do everything will be part of SRC   okay so in SRC I want to create my own package  so what is package package is just like a folder   just like a folder so what I will do is under SRC  I will create a multiple folders every day like   day one day two day three so whatever programs I'm  going to explain will be part of that particular   folder so under SRC today I'm going to create a  new folder that means new package right click and   new package you will get this window you can see  like this right click on SRC new and here you have   to take package package in the sense just like a  folder so now select the package now here you have   to provide the package name so here I'm saying day  one and click on so don't take this package info.   Java this is not needed simply say only day one  package name and say finish now we created a new   folder under SRC folder in the sense in Java we  call it as a package now inside this package only   we are going to write your Java programs so now  we'll see how to create a first and very simple   Java program very basic Java program step one we  created a new Java project step two we created   a new Java package now step three whenever you  want to write a new Java program first we need   to create a new class this is most important so  without creating a class we cannot write a single   line of code in Java so we have to create a new  class okay so what is class in coming sessions   I will detail explain at least for few sessions  just blindly follow as it is what I'm saying okay   so after few sessions you will understand what  exactly class means what is object all these   things so so how to create a new class so to  create a new class under this package whatever   package we created just right click on it new here  you can see class so just click on this class and   here this window will open in this you can just  provide a class name you don't need to change   anything here just on the name box you can provide  so here I'm just giving some name to the class I   say and always remember the class name should  always start with uppercase character this is   the naming convention so we need to follow certain  naming standards in Java I will tell you what are   those naming conventions but initially you can  just check so whenever you provide a class name   you have to start with uppercase character so you  can say first Java program or you can just give   whatever name you want I can simply say welcome  or I can say anything okay let me just give like   this first Java program first Java program so  don't give any spaces so this should be one   single word and in between if you find any words  you can use uppercase character no problem but   don't give any spaces and it should start with  uppercase character just take this name and uh   just directly click on this finish button so don't  take any of this option just provide your class   name and just click on finish so once you done it  you will see a new class is got created under day   one and automatically opens another window okay  you can close this window again if you want to   open just double click on this program Java and  you can see this window so this is a simple way   of creating a new class we'll try to understand  what exactly they are but initially we will try   to understand the steps what are the steps first  we created new Java project and you can directly   do like this go to directly file and then click  on the new and here you can say new Java project   this is the navigation and after how to create  a new Java package just right click on SRC and   then select package so how to create a package  just right click on SRC new package this is   the navigation right click on S s RC and then  package so this will create a new package now   how to create a new class again right click on  package which we created above and uh then new class so just right click on package like this new  class so this is a navigation so once you created   your class now we are ready to write your Java  program so font is very very smaller so let us try   to increase this font so even this window package  Explorer font is very small and this is also very   small right so let us try to increase this font if  you want to increase this font there is a shortcut   key okay so I can say yeah control plus if I say  Control Plus automatically this will increase the   font like this okay control minus means decreasing  Control Plus shortcut key I'll just put here to increase F in window in Eclipse  Window you can say Control Plus control Ctrl plus button so both you have to  press control plus multiple times you can press   automatically the font will be increased okay now  if I look at this the first line is representing   in which package we are writing the Java program  so the package is a keyword and here day one is   a name of the package and semicolon representing  end of the statement semicolon representing end   of the statement so every program whenever you  start writing the new class the first line is   representing the package in which package you  have created a class okay now if you look at   this these are all Java keywords public class and  this is the name of the class and starting cly bra   ending curly bra so if I look at this particular  syntax public class public is basically called   as access modifier class is a keyword which is  actually representing this is a class so in the   coming sessions you will understand in detail  what exactly they are and once you understand   objectoriented programming concept then you'll  able to understand this so next few sessions   just follow blindly just like this okay public  class class name and curly base is representing   the starting point so you can put in the same  line or you can put in the next line also no   problem this is a starting point of the class  and this is ending point of the class so whatever   you want to write in a program should be part of  this open and closing curly braces here you have   to write this is called scope of the class where  it is got started here it is started and here it   is end so this part is called scope of the class  and inside this class we have to create something   called a main method so how to create the syntax  is public static void Main in this you have to   write something called string arguments don't  worry if you not understood this no problem this   is not the right time to understand the all these  things just use it as it is the coming sessions   you will get more understanding about this so this  is a class and the name of the class inside this   we have to write something called main method  this is called main method this part is called   main method so whatever Java program you created  wherever created whenever you created you must   write this index you must write this index public  class class name started point and public static   void main main and string ARs and again this  is a starting point of main method this is a   ending point of main method this is called main  method and the class always contains the method   So currently we have created only one method we  can also create multiple methods so that we will   see later for now the class contains the one  main method so without having this main method   we cannot execute the class if you want to run  this class if you want to execute and see the   result of the class we have to write main method  so main method must and should and if you don't   have this main method you cannot run this program  first of all we have not written anything so far   just we created a new class inside this we just  created one main method so whenever you create a   new class main method must be present without main  method you cannot run the program so main method   must be present inside the class now whatever you  want to write should be part of main method now I   want to print some message some welcome message  as an output when I execute this program I want   to get some output message like welcome to Java so  how we can do that I can just write one state here system.out.print system.out.print and here  I'm writing some messages say welcome to   Java and then semic Cod I have written only one  single statement in the main method so this is   simple program I have created now when I when  I execute this program I will get output this   one so whatever I mentioned here this I will get  as an output but how to run this program how to   execute this program you can do multiple ways you  can just right click here run as Java application   or you can directly go here run menu and you  can use this option control F1 is a shortcut   key or you can directly click on this icon run  first Java program. jav so normally when you do   like like this you will get uh this window every  time whenever you run your program you'll get this   window but basically what it is saying it is  saying do you want to save this program before   running yes every time before running we have to  save the program it should always should happen   so I will select this checkbox so that next time  onwards it will not ask you to save it every time   it will automatically saved by Eclipse so next  time this window will not appear if you select   this so okay and once executed now we can see in  the console window this is called console window   and here here you able to see the output of the  program so when I execute this program you will   see this output here now I will write one more  statement here I can say system. out. print l   so what is system.out.print means so this is  actually the print statement if you want to   print something as an output we have to use this  command system. out. pinell again in the coming   sessions you will understand what what is this  system what is an out what is print in detail   we will try to understand but as of now we can  just try to understand if you want to write or   if you want to print something as an output you  have to use this command system. out. print L   and inside this bracket you can keep for example  I will say 10 + 20 10 + 20 and then semicolon so   in Java semicolon is representing end of the  statement whenever you put semicolon that is   representing this statement is got ended but  this is not applicable for class as well as   method we should not put semicolon here similarly  we should not put semicolon for main method okay   semicolon is applicable for only statements  which are provided inside this main method   every statement is end with the semicolon now I  have written one more statement 10 + 20 now when   I execute this program run as a Java program now  you can just see this is the output of the first   statement and this is the output of the second  statement in the second statement what I have   done 10 plus 20 so what is plus will do it will  add two numbers 10 + 20 30 so we got a 30 as an   output okay now this is how we can simply write  a Java program and execute your Java program then   you can see the output in the console window  and one more thing in the first first printel   statement I put this in the double quotations but  in the second statement I haven't put in double   quotations what could be the reason if you put in  double quotations then what will happen see I'm   keeping inside the double quotations now execute  and see what will happen when I run as a Java   program again see this it is just printed as it  is it is not exactly calculated the output what   does it mean whatever you keep inside the double  quotations it will exactly print in the console   window as an output it will not do any change  but we want to perform some operation here we   want to do some calculation here so whenever you  want to use any arithmetic operators like minus   plus division all those things we should not put  those numbers in the double quotations because   they are the numbers only the strings string is  nothing but what characters a group of characters   is called a string so those only we can keep in  the double quotations so numbers or when you do   some operations we should not put in the double  quotations now when I execute this you'll exactly   get whatever you want okay so this is how we can  simply create a new Java program and execute and   see the output in the console window fine now I'm  going to show you one more program you can just   close a console window close your Java and what  we understood here how to create a new class and   inside the class we have created this main method  manually and these are all Java keywords reserved   keywords we should create exactly the similar  way we should not write uppercase characters   by mistake if you make is a public is uppercase  character this is not recognized by Java you can   see eclipse is intimating you there is a syntax  error here you can clearly understand this is   another major usage of eclipse whenever you do  some mistakes Eclipse will easily identify and   intimate you see instead of lower case I put  uppercase character what it is saying syntax   error on token public so you should remove this  and put as a lowercase character same thing for   static void also these are lowercase characters  all keywords Java keywords means Java is having   their own meaning for these keywords all keywords  is appear in same color and they're all in lower   key characters and one more thing here in the  string s is uppercase character we have to write   exactly the same if you put lowercase character  then it is a error again it should be uppercase   character and same system s is uppercase character  instead of uppercase if I use lowercase character   then it will give an error so s is a uppercase  character in the coming session slowly we will   make you understand what is the naming convention  how to do it all all those things okay within one   or two days you will not get all these things once  you start practicing slowly you will understand   where exactly we use uppercase character where  exactly we use lowercase character where exactly   we use double codes where we should not use double  codes all those things you will be familiar slowly   once you start practicing it okay within few days  you will not get it takes some some time initially   you will definitely do some mistakes and do  mistakes and try to understand where exactly   you have done mistake and rectify it and try to  execute it so this is the first program which   we have seen now I'm going to create one more new  program after saving this so now I want to create   another program so on the same day one I'm going  to create new class another class and here we can   just provide only class name so this is my second  Java program so I can say second Java program and   one more thing so whenever you create a new  class which should contains a main method so   main method without having main method you cannot  execute a program main method should be present in   the class so in the previous program what we have  done we have created our own main method manually   we have written the main method but if you don't  want to write manually you can select this box   public static void means string ARS if you look  at this particular statement you can automatically   select this so that it will automat automatically  add main method inside the class if you select   this option can simply directly say finish just  observe yes it is created a new class and also   it is created main method inside this so inside  this you can put the CRA in the next line also   like this now this is a simple comment statement  you can just remove it see this the structure is   got created automatically now where we have to  write our code inside main method so here I'm   going to write something so if you want to print  something what is the command we have to use system.out.println and here we can write let's  say say welcome to Java so this statement is   end here and when I run this it will print as it  is whatever you print in the double quotations   exactly is got printed okay now suppose  I don't want to write this entire state M   system. out. print Ln sometimes when you write  complete statement you will do some mistakes   so I automatically insert this entire statement  automatically I want to write system print simply   what you can do is you can write only ciso Sy  yso s is uppercase character see Sy yso and after   typing SSO C so just press control space control  space that's it automatically the entire thing   will be added control space command is Control  Plus space so when you execute this control   space automatically the entire statement will be  added I'll show you one more time you can just   look at this see so just type c o Sy Ys o control  space if you're working on Mac you have to just   press command space okay here on Windows control  space when I say control space is automatically   added okay this is a shortcut so now I can put  whatever you want in the double potations you   can say hello so whatever you put in the double  course when I run this program you will see same   message is got printed okay now I want to show  you something here so whenever you're creating   a class you have to provide the class name so we  need to follow certain naming conventions so we   need to follow certain rules where they providing  the class name so what are the rules we have to follow rules or we can simply say naming conventions so what are the rules we have to  follow when you provide the class names the first   role is the class name should start with uppercase  character class names always start with uppercase   characters second thing is class name should not  start with number class name should not start with   number okay and class name contains underscore but  not Ione contains underscore but not Ione special   characters are not allowed class name contains  a numbers numbers also we can have but it should   should not start with the number so I'll tell  you suppose let me try to create another class   so when I create a new class it should not start  with a number let's say 1 2 3 no not possible it   is saying not valid identifier and here I can say  my class this is also not possible because it is   starting with the number for example you can do  like this I can say my class one you can put like   this one two three I can write like this because  first you need to start with the characters Then   followed by the Numbers it is allowed but the  class name should not start with the numbers   okay that's the one thing suppose if you want to  give some space for example let's say here I'm   writing my first class there are two three words  are there my first class every word should start   with uppercase character but if you want to divide  them you should not give spaces like this spaces   are not allowed but instead of spaces you can just  give one underscore underscore is allowed only   underscore is allowed from the special characters  other than underscore it will not allow you to put   any other special character suppose instead of  underscore I want to put Ione it is not allowed   Ione is not allowed okay all special characters  not allowed except this underscore only underscore   is allowed okay so while creating the class just  remember this rules class name should start with   uppercase character class name should not start  with a number class name can have underscores in   the middle of something and special characters are  not allowed and class name contains numbers but it   should not start with the number as for the second  point it should not start with the number but in   in between the class name you can use numbers okay  so these are the names naming conventions we have   to follow when you're creating a new class now go  back to the second Java program so here we can use   this method system.out.println and whatever we put  in the double course it will as it is printed in   the console window now I will try to put multiple  statements just observe this this is one statement   three four five statements so when you run this  program so the same message will be printed five   times you can see how many statements have written  five statements so you got all five statement five   times it is got printed so this is the method so  first we have to create a new class inside this   this is a method and here the method is starting  point this is the ending point here is the   starting point of the class is the ending point  of the class always remember the class contains   this method and without having this main method we  cannot execute your program prr so execution will   always start from the main method itself jvm Java  virtual machine will start executing the program   from the main method itself okay now let us see  something about comments what is comment there are   two kinds of comments single line and multi-line  comments single line multi-line comments what is   comments what is use of comments so comments are  basically improve the readability of the code for   example let us say I have written five statements  here and whenever I also enable this statement so   if I execute this by default it will execute six  statements see all of them are got executed now   I don't want to execute this particular statement  the first statement I don't want to execute simply   we can comment it so how to comment the single  line you can simply say slash slash put one SL   SL forward SL slash this will automatically  comment that line so whenever you commented   Java will not execute that particular statement  so initially you got this message after commenting   if you execute your code you will not execute the  statement rest of the statements are got executed   so whichever statement you don't want to execute  you can put the comment so for example here uh   these two statements also I don't want to execute  so just put that as a comment so when you run it   you will get only three statements only these  three got executed okay and suppose I want to   comment everything only except the first statement  and all these statements I want to comment okay   in this case what you can do is if you have just  two to three lines you can do like this like this   okay suppose we have a 20 lines or 50 lines or 100  lines of code then in instead of using single line   comment you can comment all the lines in one shot  simply you can say one slash star so this is a   starting point here you want to start comment and  where you want to end all the statement you want   to comment so at the end of the last statement you  can close this by using star and slash so now all   these statements are got commented so slash star  star slash here star comes after the slash here   star comes before the slash so this is called  multi-line comment so now when I execute this   all the lines are commented except the first line  only first line will be executed so single line   command we use slash slash and multi-line command  we can use slash slash and the starting point and   this is the ending and what is the use of this  comment it will just improve the readability of   the code and also you have written some piece  of code and you only can understand the code   you have suppose you created some variables and  some looping statements and you have written some   logic inside the program and if you provide your  program to somebody else for reading they can't   understand your code and suppose you created  some piece of code some logic you have written   they don't understand so before writing the logic  if you write some comment before that so why you   created this variable why you created this looping  state and why you created this data typee if you   write some meaningful message so others will  able to understand your code by just reading   that comment so that will improve the readability  of your code very very helpful single end comment   and multi-line comand and also if you don't want  to execute some piece of code or some piece of   lines in your uh in your program you can simply  comment them either it can be single line or it   can be multiple lines so that's how we can use  comment single line comment and multi-line comment   okay so how to create a class how to create a  main method so for few sessions at least follow   the same structure as it is and you will able to  understand this in the coming sessions slowly I'll   make you understand because we need to understand  so many other Concepts to understand this so what   is public what is class and what is static  what is made okay what is wide and what is   this string argument what is this bracket and what  is this system how print there are many things are   here so to understand all of them at least we  need to finish four to five sessions and then   you'll able to understand what exactly they are  okay we will try to understand individually what   are those keywords there's separate sessions are  there to understand this and once you understand   then we will understand the complete part what  is class what is main method what is system what   is out what is print tell so you will will get  to know exactly what what are they so this is   a basic understanding so what we have seen so  far is we have successfully installed Java and   we have also successfully installed Eclipse IDE  and then we have created a new Java project in   Eclipse we have created a new package in Eclipse  under Java same project and we have created a   new class and inside the class we have written  simple one main method and then we have executed okay so for today just practice this much try  to set up the environment install Java install   eclipse and once environment is done then create  a new project in your eclipse and before starting   Eclipse it will ask you the workspace create  a workspace and create a new pro project and   every day I will create a new package like  this let's say day one is today tomorrow day   two day three day four like this every day  I will create a new folder new package and I   will create all the programs and I will share  these coded code examples on day-to-day basis   okay and to install eclipse and uh Java uh you  don't have any specific restrictions actually   you don't need any system specification just  8GB Ram is enough if you have you can just try so you can just run that app as an  administrator sometimes you may not have   privileges to run the applications so in those  cases what you can do is for example you have   downloaded this Eclipse software right instead  of directly double clicking on this you can   just run as an administrator right click run as an  administrator so that it will execute the software   as an administrator sometimes if you do not have  proper privileges you cannot run the installers on   your system on your PC so in those cases you can  just just run that software as a administrator   then it will continue to execute any software  whichever download you have done you can just   run that as a administrator and if you're working  on Mac users you guys also open the terminal as   an administrator connect to the administrator user  and try to install all the softwares right so that   is all for today's session so just try to do this  for today just try to understand install and get   the environment ready and once the environment is  ready then create a new Java project new package   and try to create a new class and just try to play  with them okay just create multiple classes and   see how they are executing and how you're able to  see the output in the console window and try to   change something in this print statements okay  and then try to execute and see the output so   explore these things first you get familiar with  these things because you do lot of mistakes uh as   a beginner okay so you do lot of mistakes and try  to figure out what the mistakes you have done and   rectify them and also Eclipse will give you clear  ination clear notification if you do some mistake   so correct it and then you will able to run it  and try to put the curly braces correctly okay   whenever you open the curly place it should  end here and here the main method curly place   it should end here okay only the statements  should have semicolon main method and public   class these class and main method should not have  any saing colors so just get familiar with these   basic stuff and from tomorrow we'll continue  the further Concepts okay all right so that's   all for today's session I will stop here rest of  the topics we will discuss in the next session