First Java Program Explanation- Part 3 -javac, javap, java, javadoc tools and command prompt usage

Learn Java www.youtube.com

Brief Summary

This video provides a detailed explanation of Java installation, focusing on the communication between the operating system and the Java programming language. It explains the structure of the Java software after installation, including the roles of JDK and JRE, and how to set up the environment variables for Java compilation. The video also covers the compilation process, syntax and semantic error checking, and the generation of .class files.

  • Java software is divided into JDK (Java Development Kit) and JRE (Java Runtime Environment).
  • Java tools like Java C, Java, JavaDoc, and JavaP are located in the JDK's bin folder.
  • Setting up environment variables is crucial for the operating system to recognise Java commands.
  • The compilation process involves syntax and semantic error checking, leading to the generation of .class files.

Introduction to Java Installation and Setup

The video begins by addressing the Java installation process, clarifying that while the initial steps may be complete, further setup is required. The author aims to illustrate how the operating system and Java programming language interact, using a diagram to explain the communication process. The video highlights that while users typically only see the output of Java programs, there are numerous background processes that need to be understood.

Understanding JDK and JRE

After installing Java, the software is divided into two main parts: the JDK (Java Development Kit) and the JRE (Java Runtime Environment). The JDK contains development tools located in its 'bin' folder, including JavaC (for compilation), Java (for execution), JavaDoc (for documentation), and JavaP (for complete description). The JRE, on the other hand, contains a 'bin' folder and a 'lib' folder. The 'lib' folder contains an important file called rt.jar, which is a Java archive file containing pre-defined Java classes, interfaces, and modules.

Operating System and Memory Allocation

The video explains how Java is installed within the operating system, typically in the C drive under Program Files in a folder named Java. This folder contains the JDK and JRE. The operating system manages these installations by default. The video uses a visual representation of the computer's memory, dividing it into C and D drives, to illustrate where the Java folder is located.

Writing and Saving the First Java Program

The video guides viewers through writing a simple Java program and saving it in a specific directory (D drive, Java 3 folder) with the .java extension. The file name should match the class name (e.g., Sample.java). The author explains that this .java file is a source file, which cannot be directly shared with clients and must be converted into a .class file.

Compilation Process and Command Prompt Setup

The video transitions to using the command prompt to compile and execute the Java program. It explains how to change the command prompt's directory to the location where the Java file is saved using commands like "D:" and "cd Java3". This ensures the command prompt points to the correct directory for compilation.

Setting Up Environment Variables for Java

The video explains the importance of setting up environment variables for Java to ensure that the command prompt recognises Java commands like "JavaC". The command prompt searches for the JavaC tool in two locations: the operating system's command list and the environment variables. The video guides viewers through the process of adding the Java JDK's bin folder path to the system environment variables via Control Panel > Advanced System Settings > Environment Variables.

Compilation Process and Error Checking

Once the environment variables are set up, the command prompt can identify the JavaC tool, activating the compiler. The compiler then checks the Java source file for syntax and semantic errors. Syntax errors refer to grammatical mistakes, while semantic errors relate to the structure of the Java code. If no errors are found, the compiler generates a .class file.

.Class File Generation and Types

The video explains that if the Java program is free of syntax and semantic errors, the compiler generates a .class file, also known as bytecode or intermediate code. This .class file is then sent to the JVM (Java Virtual Machine). The number of .class files generated depends on the number of classes, interfaces, enums, abstract classes, and inner classes defined in the Java file.

Platform Independence vs. Dependence

The video touches on the concept of Java being a platform-independent programming language but notes that JDK, JRE, and JVM are platform-dependent. The video sets up the discussion for the next session, which will the differences between JDK, JRE and JVM. The JDK represents compilation, while the JRE represents execution.

Summarize any YouTube video in seconds

Get summaries like this one for any video, in your language, with the free Summ app.

Download on the App Store
Get it on Google Play

Transcript

YouTube Transcript Generator

0:01 I have started the recording yesterday uh we have just discussed about the Java installation you ask me if the installation is completed no it is not completed we need to do little setup on top of that installation right uh like uh I have already taken you through some steps to download and to perform installation of course if you have done those if you have followed those steps then installation is almost complete but we need to do little setup before even proceeding with the setup uh I will like you know I will just try to help you out with small things like how operating system and how Java programming language is going to communicate with each other so this is

0:47 the I LEL diagram I level illustration this will be very much very interesting see whenever we are writing a Java program in a notepad right we do compilation and we do execution and we follow we use we just use two commands two prominent commands which are Java C is one of the commands and Java is the another command this commment is going to perform the compilation this commment is going to perform the execution right so like uh when we do this you just see the output isn't it but there are so many things happening behind I mean behind the things so many process are happening we need to

1:32 understand what is happening behind the things that understanding is very important right so we know what we know what and uh we have to understand how how it is happening behind the scenes right today I will help you with that so since I mean in our last class we have just completed installing the Java software right so after installation this is how the software looks like in our last class we have just completed the Java installation and after installation this is how the software looks like the software is divided into two

2:20 parts one part is one part is for jdk and the another part is for J jdk and we have J we have already discussed jdk is nothing but it's an acronym for Java development kit Java runtime environment we will see these things in things in actions to Java ja Java development kit and Java run runtime enironment this is the Java software Java software by default will get installed and after installation is going to have two folders one folder is shdk another folder is Shi right I will keep it very simple

3:08 inside this jdk if you seek I mean if you get inside this jdk folder you will find another folder called bin inside this shade we have a folder called what bin it is a folder it is a like that is how it is defined by the Java the folder name is bin inside this folder you will find a lot of java tools just inside this folder you will find lot of java developing tools what are they what are they actually we will understand them today so the tools are like the tools are in the name of I mean uh you can recognize this

3:54 tools they are the most powerful tools Java C is one of the tool Java is another tool Java Doc is another tool and uh we will take one more tool for example and Java B is tool these are the tool tools that are available in this bin folder each and every tool is going to perform a job right so these are the tools that we often use in the command Pro Java C performs compilation Java performs execution Java doc document generation and Java P complete

4:40 description right let me write that here compilation compilation and uh execution document generation generation and Java P is for complete description and these tools are not limited to four there are many tools but these are the prominent prominent tools that we come across that we have used this tool very often Java C Java we have used this in the command prom in the in the form of commands commands Java commands the shva commands are available

5:25 in the bin folder and which is available inside jdk right in the inside the Java development kit we have developing tools so all this together we can say it as what developing TOS which are called as developing tools let me write that here developing tools Java developing tools right and another another folder has been created after the installation these folders are created by default you have nothing to do with this let me show show this

6:10 folders so in my computer by default the Java has been saved in the program files inside this program files there is another folder called Java if I open this there are two folders one is jdk and second one is J each and every folder I mean jdk is developing tools so let me open jdk inside there is a bin inside this bin you can file the see Java Java V is one of the developing Tool uh hope you're able to see this Java C this is the developing tool this another developing tool and we see lot of tools but the prominent ones are what Java P Java talk there is a Java talk

6:56 somewhere it will be here and we have a tool called Java just Java will be somewhere these are the tools that we come across in the bin folder Java P Java H Java doc Java C and Java right hope you're able to see

7:48 so I'm going to help you out about this uh uses of this tool and how to access this tool so these things are very important so please pay some attention there screenshot and uh so let me write some theory for for better understanding Java tools or we can say Java developing tools are part of the Java development

8:34 kit and this tools are used to perform some operations on the Java programming language by default I mean after the installation by default they will be made available in the C

9:21 drive program files Java folder adk folder and pin side pin you will find you will find Java TOS right hope this is making some sense so inside jdk we have Java tools with this to this Comm these tools we are going to us in the command Pro to perform some operation we going to see about it in a crystal clear way okay so let let us go back to this J is nothing but it is an acronym for Java runtime environment you have seen thisday

10:08 Java time so in the Java runtime environment you will be finding a bin folder a bin folder and a lip folder there will be two prominent folders that will come across in J one is bin folder second one is lip folder in folder second one is Li folder let me show you the part J you have been you have live right

10:54 if you open bin so there will be many jar files so we do not have to worry about this jar files if you open Li there will be a specific jar file called RT JW this this this is very important RT hope you're able to see this r r f so inside the LIF folder we have a file called

11:44 rt. J file is nothing but Java archive file I will explain you what is J file Java archive okay so Java archives are nothing but a collection of collection of dot classes collection of interfaces the collection of modules we can say all the modules are collected into a single single entity single unit right so inside the J Do jar file you will be finding lot of predefined java ja do classes I can write it in a simple way inside

12:33 this you will find a l of predefined classes right so very simple let me keep it very simple once once after installing the Java you will find know a folder called Java and when you open this you will find a jdk folder and J folder inside this jdk folder we will be having tools tools for development right inside JRE you'll have to remember only one thing rt. j file right inside this jile we will have lot of predefined class this understanding is enough with this understanding we will go forward right so let us understand as soon as for

13:21 example let me uh do some partition okay so let this let us assume that this is my please Focus here this is very very very important let's assume that this is my operating system right I'm using Windows operating system let me write that here Windows operating system Windows 64bit operating system let me be very specific operating system so in my operating system I have like we have temporary usually we have what we have usually have temporary storage and a permanent storage

14:08 temporary storage like Ram comes into picture for the temporary storage isn't it so if you talk about temporary storage Ram comes into picture Random Access Memory but if you talk about permanent storage like hard disk or SD SD card comes picture right to see my computer let my let me take my laptop as an example right so my laptop memory has been as has have two partitions one is C dve second one is three I have two partitions so let me do the same here this is my assume that this is my uh like you know SD card and I have two drives one is C drive second one is D

14:54 drive so let me take this as C drive and this one is d d right I have two two drives one is C and second one is D so usually all the softwares all the system softwares all the operating system will be installed in the C drive all the program files if you talk about program files if you talk about operating system everything will be inside what inside C drive let us assume that this is my operating system let me reduce this sp

15:42 Let Us assume that this is my operating system Windows operating system Windows operating system has occupied some space in the C right inside this Windows operating system we have I have a lot of softwares let us say that I have softwares like notepad Ms paintt and all the windows OS me we have like Ms word all the Microsoft offies and apart from that I might I may I may also have command prom this is the command prom that is contained in my operating system so let me write this is let us imagine that this is operating system and inside this I have a command

16:34 my command prom and this is my o right so I have installed if you see my Java has been installed in C drive by default the installation has happened by default in the C drive inside the C drive let me show that here I go into the C drive so there is a folder called program files inside this program files and the there is another folder called Java so these things are taken care of the operating system while performing the installation by default these folders are created and inside these folders uh we have a lot of folders inside jdk and we have a whole set of folders inside J these things are taken care by the operating system itself because during installation these things

17:20 happened by default without my control hope you're able to understand without my control these things has happen right so assum that the Java has been installed and let me go back to this memory so Java has been installed here so this is the Java folder just imagine that this is the Java folder let me write that this is inside the Java folder I have what jdk jdk and

18:10 J right so everything has been uh stored I mean everything has been saved in the C drive by default these things has happened without my control by default it has happened this is jdk and this folder is minant for J J and let me write sounds good inside JK I have shown you some comments right the comments are like inside jdk we we have found a folder called bin folder inside bin folder we have some we have seen some prominent commands some

18:56 important commands some some some tools some powerful tools like what Java C for the time being let us assume that we have Java C and Java command these commands are contained in the pin folder folder right inside J we have we have found a file called rt. archive file inside J we have a folder called lib isn't it that's what you saying inside the LI folder we we have

19:41 rt. rt. right so these many things has happened after the Java installation memory has been occupied in the SE right so for so far so good right so what happens if I write the first Java program we understand behind the scenes we will understand what how the from the memory point of view from the operating system point of view from the Java point of view how these things are communicating with each other so we are going to understand that so far we have discussed saving the Java file compilation and execution right we have discussed what is what right but we have to discuss how it is happening behind this what is happening behind the right so let me take a small sample

20:27 Java program class sample because uh I'm keeping it a sample to keep it to make it simple okay public static main thinging ARR box and you don't you don't find these things in anywhere in the internet so please pay some attention understanding is very important system do out print h a simple Java program a typical Java program right name of the class is sample and uh a public I mean a main method is there

21:13 and and a on line instruction inside the main method so let me save this while saving this we usually prepare the location now see now understand one thing I am I am trying to save this in the D drive new volume d inside R there is a folder called Java 3 right here I'm trying to save it I deliberately choosing to save this the D drive right so the name of the I mean uh it should be saved with the Java extension we know that already and uh the file name should be same as the class name here the class name is it is recommended to be same as the class name sample. Jaa if it is public it is mandate it is compulsion if it is not

21:59 public it is just a recommendation okay sample. save now let me take you to the folder to see this uh program this code has been saved inside the D drive I have two Drive C and D inside the D drive inside the Java folder Java 3 folder so let me delete this two okay the sample do Java has been saved inside where inside the D drive inside a

22:45 folder called Java 3 this is where I OB Saed right so let me go back the paint so in the D drive inside the D drive I have created a folder called what Java 3 Java 3 inside Java 3 we have a file called what sample. Java let me give it right the name of the file is what sample. Java let me write

23:37 also sample. Java right so this has happened so far so this is how uh we one can imagine right C drive D drive and uh the main Java software is inside the C drive we just did the installation setup is not yet complete I will I will make you to understand how to complete the setup right so we have already I have already told you many times this is called as what file Java file is also called as what source file right you cannot share this source file to the client so in order to share this share your information you will be sharing in the form of do class files Source F source files cannot be shared

24:24 directly it has to be converted to class files and you will share the as well right so before even like uh now let us take the command prompt into the picture now we need to perform the compilation and execution by using what by using command PR right let us assume that this is a command promt so command prompt is here I'm just maximizing it here just just an assumption right Comm Pro I just opened the Comm PR so let me open my command

25:15 B hope you're able to see my command if you see the command prompt the command prompt is pointing to a different location so C drive users user but you must understand that I have saved the Java in the D drive inside the D drive I have created a folder called Java 3 right inside inside Java 3 folder I have saved the file in the name of sample. java I need to change the directory here I need to ensure that the command prompt is also pointing to to the directory where I have saved the Java file it make sense no so this should be this should not be this location should be changed order to change the Lo very simple command I will

26:00 use so which Drive the file is get f file has been saved inside the D drive right to change the drive just use a simple command capital D semicolon just given now the command prompt is pointing to the D drive right is just like command prompt is just what inside the D dve right and we have to we have saved the file inside this Java 3 folder inside the D drive we have a folder called Java 3 I need to ensure that the command prompt is pointing directly inside this Java 3 folder I mean inside this location in order to do

26:47 that I will use a I will use another command called CD PD means change directory SP keep the folder Java 3 right so now the command prompt is pointing towards the same location where we have saved the Java file source file hope this is making sense just type guess in the chat box if you are able to follow till now till now okay sounds good good now some magic will

27:33 happen see we have just changes the directory let me copy this let me paste it for your understanding I'm uh just trying to paste it over here we have used these three little commands first so right for this making sense now this command I mean uh this line the third line in the command prom is what it says command prompt the control is directly pointing here to this F to this folder yes the control has come inside the

28:20 folder command prom is pointing towards let me take it in Black this direction okay now we need to perform the compilation we ensured that the commander command Pro is pointing towards the source file but the source file needs to get compiled in order to perform the compilation we need to use a we need to use one of the Java tools for the compilation what is the Java tool we have already seen some Java tools we have to use Java C this is for compilation so in the command PR I will be using what Java c

29:09 space I need to use the file name what is the file name is pointing towards sample. Jaa I need to use this I'm using a different name like ABC do Java what happens here is not able to find right so I need to use the exact name exact F Java CS space sample. Java right so before even giving enter let me tell you one more let me show you one more thing so this is the next commment for the compilation so I have used a tool called

29:57 Javas C right we have installed the Java everything is fine but in the command prompt I used a command called Javas so what will happen is let me write that here whenever point1 whenever the programmer uses Javas C command inside

30:45 the command prom the command fromom will pick for the tool in two locations two locations because we are just commanding inside we are just asking command prom to compile this but command prom should recognize this command Javas this commands this command should be recognized by the command Pro right that's why it will check whether this command Java C is the part of operating system first it will check in the operating system in two location first it will check in the operating system Windows operating system in this case we'll check if the if the Javas C

31:31 command is located in the operating system commands command list right since it is a Java command it is not possible for this particular command to be located to be identified in the operating system it is not getting identified in the operating system it will search in the enironment variables enironment enironment variables there it is two locations okay let me show you that what do it really me I right we have used command we have used Javas

32:17 right so yesterday we did not talk about the setup we need to inform the command prom inform the operating system that we are going to use some set of java tools for the set of java tools if you see these Java tools are located in which location in inside Java Java jdk bin inside inside the bin folder these tools are located we need to inform the command PR before even executing the program how we how we should inform the command PR that's the question right so go to the Comm control panel open the control panel inside the control plan just type environmental variables right uh you will see a lot of

33:03 options computer name Hardware Advanced right click on Advanced click on environmental variables environment variables right you will see two like a kind of two folders user variables for users system variables you go and see the system inside the system variables there is a uh word called PA you click here just give edit right inside this if you see here you're able to find a path called C program files Java jdk 1.8.0 something like that like a pin folder is I have I have uh like given the

33:48 directory here I have set up The Path here you're not setting up the path here the Java C command will not not be recognized let me repeat that once again so whenever you're using Java C command the command problem Java C Java command this command prom is going to check this in two locations one is in the operating system command list will not find secondly it will find it in the environment variables inside this environment variables again we have two categories one is system user variable second one

34:34 is system variables system variables and user varable variables right so in here you have to define the path here so if you're defining your path here so Define the path for what you have to define the path for this Java Tools location Java P Java C Java do Java do these are the developing tools that are located in

35:22 this in this path Java jdk bin inside this spin folder this tools are available right so you need to define the path in the in any one of the variables either you can Define it in system variables and either you can Define it in US user variables the difference is very simple if you are only one user you can Define it here you can set the path here in your system if there are multiple users you can Define the path in the system variables right some restrictions will be that if you are single user you can Define it there but in your multiple users and Define it in the system variables right just defining is nothing but just defining the path so this is the PA let me copy and paste it here Java

36:08 C Java not Java program files inside the program files there is a folder called Java inside Java jdk pin just copy this path and paste it in the system variables or the user defined variables as simple as now after pasting it here the installation will be completed this is what we call it as what complete installation we need to we will have to paste it here either here or here depending upon your operating system to ensure that uh the directory is getting Ed at the bin folder because

36:54 inside the bin folder we have Java tools right so I will also attach screenshots inside the control panel go to the control panel and the control panel and search for environment environment variables and go to Advanced click on environment variables and in order to set the path there is a uh like you know you can see the path part thing here click on that click on edit you will find lot of options click on new past the path here click okay that's it since I have already have the path

37:40 I'm not doing it since you will have to do it after doing it you will able to compile the program you're giving the intimation to the command command prompt to your operating system that I have some tools for the Java development those tools are available in this particular path but just giving the information that's it right now what happens as soon as you give Javas C command the command PR is going to check your uh command in two locations so this is the command that we have given isn't it Javas so this command will be checked in two locations firstly it will check in your operating system command list your Windows operating command list it is going to check if it is if it is not

38:26 available in the list of uh the command list in your operating system it is going to check in the environmental variables and again ins the environmental variables there are is again bated into two parts system variables user def variables so in the system variables or defend variables if it is finding the path then it will go to that location after finding the path the control will be transferred from here to the exact path from here to here Javas is able to identify now what

39:14 happens listen here very listen okay as soon as it finds finds the developing tool developing tool it will activate the compiler very very important how the compiler will be activated will activate the

40:00 compiler compiler will be activated so as soon as it h the Javas command as soon as it a Javas command compiler will be activated right that's what I said as soon as it finds the developing tool it will activate the compiler next Once the compiler is activated the compilation will be perform and it will take the source

40:46 code that we have defined following I mean it will take not the source it will take the source called or the file that we have defined following the Java C command what I mean is following the Javas comp we have defined the source file sample. Java it will take compiler will take this source file inside that's what it will take the source file that we have defined following the Java C command it will do again it will do two things first thing

41:43 is it will check for syntax syntax errors syntax errors it will check if there are any syntactical errors errors in the code syntax errors are nothing but grammatical mistakes secondly it will take for semantic errors semantics errors are nothing but the structure of the Java code I'll explain iture of the Java code right what I'm trying to say is say

42:31 here is so this is the compiler let us assume that this is the compiler and we have just uh ensured that we have just activated the compiler so after as soon as the compiler is activated is going to take inside this sample. Java f it this is sample. Java F this will be sent to compiler right compiler will perform two operations one is it will check for syntax error secondly it will check for semantic errors of the comp it will perform two operations so let me uh like take the same code

43:17 here so syntax errors are like syntax errors are it will check each and every keyword first it will check class whether the class is a keyword it should be in the lowercase letter right and secondly it will check this should not have any spaces I mean uh this uh sample sample is a full uh like fully fully evolved world right it has no it has no spaces and each and every word it is going to check that is what we call it as what syntax it will check if there are any syntax errors exist existed right so what kind of checking it will be it will check if it is if

44:03 this program is violating the Java keyword keywords rule we'll check if there are any violations they are called as what syntax errors what is semantic errors semantic errors are nothing but structure what is structure I already said the structure will look like a typical Java program structure will look like what like this firstly we will have the package command section comment section you already seen this second one is package section third one is import section fourth one is class

44:52 section right and inside this class method section this is for the structure it will check if the program the developers program has followed this structure this the this are called what semantic checking semantic errors it will check for the structure of the program right this package seure you cannot keep this package section should always be top and this command section can be anywhere it can be uh anywhere that is not a what compulsion so by default the package section should be on top you cannot have the package section

45:37 inside the class or inside the method it should be always on the top and input section should be after the package section and after this two you can have class section this is what the semantics this is what the structure is if those if these two conditions are valid if these two conditions are qualified what happens the compilation will be successful how do we know that compilation is successful it is going to generate do class file again I'm saying let me write that after the

46:24 okay if the program is free of syntax errors semantic err then the compiler will perform the compilation perform the compilation and generates generates the do class

47:15 F this dot class files are also called as F code or intermediate code and this will be send to the table as simple as that so in this case uh the sample. Java will be converted into what sample. class f a simple over here it will converted to what sample do class this is what happening behind the

48:00 SS so behind the SS what are the things that are happening behind the SS right first we need to uh specify the path path of the current location where we have saved the Java Pro after that in order to do the compilation this is the command for the compilation but as soon as the command PR find this compilation command it will check in two locations one is in the operating system second one is in the Environmental variables and again inside variables we have system variables and we have user there we have to define the path where the command prom can identify this Java C tool Java C tool is found inside where it is found inside this location this location is inside bin bin is inside jdk

48:46 jdk is inside Java Java is inside program PR program files and program files are inside C drive so as soon as the command the tool is identified as soon as this tool is identified Javas tool is identified compiler will get activated once compiler is activated what happens internally compiler is going to check for syntax errors and semantic errors

49:33 syntax is nothing but the grammatical mistakes semantics are nothing but whether it is following the structure of the Java program or not right when these two when there are no violations it is going to generate dot class file and this dot class file will be sent to jvm that is that is something that we will understand now I hope uh so far it is clear and just type as in the chat box if you are able to follow me or you can raise any questions if you have are able to understand what about you Ganesh and sashan okay sounds sounds this many things are happening behind the

50:19 scenes so let me uh show you the real time so let me so there are no errors if you find the cursor is blinking as soon as you hit enter right it means that compilation is successful how do you confirm that compilation is successful you will you will have to see the do class file so let me show you that so do class file will be generated in the same location which location the location that this is pointing to D drive Java 3 Java 3 is the folder this is where you will find what do class files so let me take you to the location right Java 3 so previously we had only Java file after compilation

51:04 this the do class file is generated let me open this I think you can read this this is something you cannot understand this see it's not readable that's why it is called as what bite code or intermediate code it is using some kind of language where only system can understand you you as a person we cannot able to uh decrypt this program this is called as do class file so do class file when the dot class file is generated it it means that the program has no errors compilation is successful right now the question is let us say that I have I have class sample let me

51:52 take make two more classes Class A class so in this example I have three classes right in a particular Java file I have three classes yes or no right yes so if I compile this how many do class files will be generated answer me answer me in the chat box in this Java file I have three classes if I perform the compilation how many class files will be generated I want you to answer come on very simple now how many class files will be

52:38 generated BG Ganesh in this file I have three classes Class A Class B Class if I perform compilation how many plus files will be question is very simple now yes three that's correct three class files will be generated what what's are what's in there it's very simple question three class files will be generated so let me do that let me delete this let me save the program and perform

53:24 the compilation so now you don't see anything right let me save the program so I have just saved it this is the proof that I have saved it sample. Java source code so after the compilation let us see how many class files will be generated the compilation is successful and you see three close files a b sample class class right the answer is very simple do class files are equal to the number of classes that you define in the Java file very simple

54:10 answer let me write that down please rejoin after 9:00 call gets disconnected 2 three please rejoin the class is going to be for little more time for 10 to 15 minutes how many do class files will be rated in after the compilation answer is very

54:59 simple it depends upon number of classes that we Define in a Java or you can say of it is directly proportional to the number of classes cles right hope this is making sense and again so it is not like the do class

55:44 files will be generated only for the Java classes there is no rule like that do class file will also be generated for interfaces so we have a we have a containers like interfaces are similar to classes class files will be generated for interfaces it will be generated for enums it will be generated for inner classes I will explain all this in the future will also be generated for abstract classes abstract classes you find this if you find interface and class file will be generated for interfaces you find enam the do class file will be sented for enams inner classes so let me make this

56:29 very clear let me delete all this so this is simple class file right so let me take an interface interface is just like a similar to class file but it is going to have different functionalities we will see that in the future what I'm trying to say is do class files will also be generated for interfaces enum enum is also a keyword class file will be generated and abstract class abstract class abstract is a keyword and class is a container and class file will be generated for abstract classes also and inner classes inner classes means a class within a

57:18 class this is don't get confused now count this we have uh so totally for interface one do class file will be generated for enum second do class file for abstract class third do class file for outer class fourth do class file for inner class fth do class file for uh sample class totally six do class files should be generated

58:19 so totally I was saying totally six. class files will be generated for interface 1. class f for en don't don't worry about this this keywords interface enm they are just like similar to classes but they have some additional I know a different functionalities so far we have discussed just about class right we will discuss all this in the future what I'm trying to say is do class files are not limited to classes class FES will also be generated for interface abstract class A Class key followed by an abstract key they are called as abstract class inner class inner class is nothing

59:04 but uh a class inside a class right totally totally uh we are anticipating six do class FES let us check that let me save this before even saving let me delete all this deleted file save so let me see okay sample. Java has been saved after compilation we will see how many class files are getting generated cace sample do compilation is

59:52 successful see 1 2 2 3 4 5 6 six do class files are so we have for interface one class file second class third do class fourth do class outer class fifth do class or sample class six class so this is all about the do class the second question is like this question two classes are limited only to the

1:00:41 classes the answer is no the do class files will be generat for the following entities they are classes class let me write like this class interface enams en St class in class so you have five entities five containers where you can where do class

1:01:27 files are where do class files can be generated for this five containers classes interfaces en abstract class and class this is also a popular interview question right now tomorrow the question is going to be I mean today we have completed about compilation I hope the compilation is making some sense today Java compilation and this this is what the internal things are this is what the behind the scenes today we have talked about jdk and need to to introduce one more thing see this is also Reon here let me take this place let me take this place so so far we have understood that Java is platform independent

1:02:15 programming language this is what our understanding is this is one of the popular interview question Java is platform independent programming language platform independent programming language jav is but when you when you jdk jdk is nothing but Java development kit the question will be like what is the difference between jdk versus J versus

1:03:03 J Java language is for platform independent but jdk is platform dependent K is also platform dependent we'll get explanation for this tomorrow dependent and jvm is also platform dependent why they are platform dependent we will understand that tomorrow jdk jbm J are platform dependent what is the difference between

1:03:49 jdk so far today we have just seen this things jdk is that J is there jda there is a folder called pin inside this folder we have some tools Java tools this tools are used for the Java development we have understood uh things like that and we have a j and we need to talk about this rt. this will be completed tomorrow so J When J is coming into picture jvm will also come into picture execution part will come into the picture so far we have discussed about the compilation part so jdk is representing the compilation J will represent the execu understand that jdk is representing what

1:04:36 compilation will represent execution execution and again there will be some scenes happening behind behind the behind executing the behind performing the execution that we will discuss about tomorrow and the most most frequently Asked interview questions are like what is jdk what is J and what is J that we will understand tomorrow people are saying Java is a platform independent programming language but this jdk J and jbm they are platform dependent platform dependent why it is platform dependent this understanding uh we can uh understand this further tomorrow right write this notes and try to set the path by yourself

1:05:23 today inside the environmental variables by seeing this video get the PA by yourself and try to run the Java program by using the not right if you have any doubt see this video and uh tomorrow we will complete what we'll complete execution part compilation is done class files are generated tomorrow we'll complete execution

Share

YouTube Video Summaries