#4 How Java Works

  Рет қаралды 477,783

Telusko

Telusko

Күн бұрын

Check out our courses:
Complete Java Developer Course Batch-3: go.telusko.com...
Coupon: TELUSKO10 (10% Discount)
Enterprise Java Spring Microservices: go.telusko.com...
Coupon: TELUSKO10 (10% Discount)
Master Java Spring Development : go.telusko.com...
Coupon: TELUSKO20 (20% Discount)
For More Queries WhatsApp or Call on : +919008963671
Udemy Courses:
Spring: go.telusko.com...
Java:- go.telusko.com...
Java Spring:- go.telusko.com...
Java For Programmers:- go.telusko.com...
Python : go.telusko.com...
Git : go.telusko.com...
Docker : go.telusko.com...
For More Queries WhatsApp or Call on : +919008963671
website : courses.telusk...
n this lecture we will learn:
Steps to execute the Java code
What is Byte Code?
Java is a platform-independent language
Execution always starts from the main method
Object-oriented language
What are JRE and JDK?
#1
Steps to run the Java Code:-
We required JVM to run a java code.
The job of the JVM is to execute the java code that you have created but it does not accept the code directly.
JVM does not accept the Java code as it only understands the Byte Code.
Java compiler also known as javac is used to convert java code into byte code.
The extension for the byte code is .class
Thus, the code written by the programmer is first converted into byte code by the compiler and then that byte code goes to the JVM for further execution.
Programmer- Java Code- Compiler- Byte Code- JVM
#2
Java is a platform-independent language:-
It means you can run Java on any machine irrespective of any hardware or operating system.
The one thing that the machine requires to run a java code is a JVM.
:- JVM is platform dependent and it needs to be built for a particular OS.
#3
In Java, execution always starts from the main method:-
JVM starts execution only with one first file. If you need to run multiple files you need to tell it which one is the first file through which JVM can start execution.
The first file must contain the main method with its proper signature.
In Java, execution always starts from the main method.
Signature of main method:
public static void main(String args[])
#4
Java is an object-oriented language:-
Object-oriented means everything should be an object.
We always required a class to create an object.
#5
JRE:-
To run the Java application, you need extra libraries and need runtime. Runtime is something where you run things.
You use extra libraries, and you also need an environment. An additional layer is present above the OS known as JRE.
JVM is a part of JRE. JRE includes JVM and libraries.
JVM - Java Virutal Machine
JRE - Java Runtime Environment
For development purposes, you need to install JDK (Java Development Kit) which consists of JRE and JVM.
Java is WORA that is Write Once Run Anywhere provided that JVM and JDK installed.
Github repo : github.com/nav...
Java:- bit.ly/JavaUde...
Spring:- bit.ly/SpringU...
More Learning :
Java :- bit.ly/3x6rr0N
Python :- bit.ly/3GRc7JX
Django :- bit.ly/3MmoJK6
JavaScript :- bit.ly/3tiAlHo
Node JS :- bit.ly/3GT4liq
Rest Api :-bit.ly/3MjhZwt
Servlet :- bit.ly/3Q7eA7k
Spring Framework :- bit.ly/3xi7buh
Design Patterns in Java :- bit.ly/3MocXiq
Docker :- bit.ly/3xjWzLA
Blockchain Tutorial :- bit.ly/3NSbOkc
Corda Tutorial:- bit.ly/3thbUKa
Hyperledger Fabric :- bit.ly/38RZCRB
NoSQL Tutorial :- bit.ly/3aJpRuc
Mysql Tutorial :- bit.ly/3thpr4L
Data Structures using Java :- bit.ly/3MuJa7S
Git Tutorial :- bit.ly/3NXyCPu
Donation:
PayPal Id : navinreddy20
www.telusko.com

Пікірлер: 186
@aeroabrar_31
@aeroabrar_31 Жыл бұрын
This is the explanation which every java developer needs, Kudos and Thank you sir.
@satyakanna4220
@satyakanna4220 Жыл бұрын
This is the Marvelous Explanation sir Please provide Interview Questions Asked For Java Developers.
@alessandrocupaiolo6859
@alessandrocupaiolo6859 8 ай бұрын
I work as Java developer since 2 years ago, and no one told me everything i watched in this video. Really thank you :)
@hari-7872
@hari-7872 3 ай бұрын
Superb sir Anyone in 2024❤️
@Davetonacademy
@Davetonacademy 3 ай бұрын
Here bro
@priyanshsrivastava3443
@priyanshsrivastava3443 2 ай бұрын
yepp
@balive053
@balive053 Жыл бұрын
Thanks for the great and clear explanation! I didn't know this about Java when I started learning it.
@havory6621
@havory6621 Жыл бұрын
If VS Code gives you an error of the type "package system does not exist" make sure to have the "s" in "system" to be capital letter, alongside the first letter of string it also must be a capital letter.
@AbdoulayeZakaria-u3y
@AbdoulayeZakaria-u3y 27 күн бұрын
Wow, that's the type of instructors that all beginner in programming need
@chiltoncharles
@chiltoncharles 11 күн бұрын
The explanation quality of this video is outstanding, thank you so much my brother, may god bless you
@gayathriyendru2147
@gayathriyendru2147 6 ай бұрын
If I ever learned anything in the Java world it is because of you sir!! Thankful forever!!❤
@funatsun
@funatsun 2 ай бұрын
hii bro,i got an error in javac hello.java i checked the code also...and i didnt got hello.class? at 8:42
@traveltribethings1336
@traveltribethings1336 8 ай бұрын
you explained this so beautifully! The most best part about your videos are unline others, you always try to give in depth knowledge on what happens in the backend which makes it more easier to learn.. I havent done coding in my entire life, but your videos are mind blowing!!! Keep explaining logic and concept wise..Great work!
@BuiHoangucAnh-tn5fz
@BuiHoangucAnh-tn5fz 4 ай бұрын
This is the explanation which every java developer needs, Thank you sir.
@faaizuddin5090
@faaizuddin5090 Жыл бұрын
Assalamualaikum sir, how you are ? I'm from Pakistani I watch your all video . Sir kindly upload advance java courses which based on industry requirements.
@mohamedabdullah3801
@mohamedabdullah3801 Жыл бұрын
Walaikum salam
@devilsingh6052
@devilsingh6052 Жыл бұрын
Jai Shree Ram 🚩🚩🚩🚩🚩
@abhisera3769
@abhisera3769 Жыл бұрын
Love from India bro
@NoahMichaelZ
@NoahMichaelZ 11 ай бұрын
Hello, I'm From france and I'm learning java online and I found your channel when I first search for java videos. I watched all your java videos and thank you so much for these videos, I'm really grateful to you.
@JEEVI-y2k
@JEEVI-y2k 9 ай бұрын
France 🇫🇷????
@NoahMichaelZ
@NoahMichaelZ 9 ай бұрын
@@JEEVI-y2k quoi ? qu'entends-tu par France ?
@NoahMichaelZ
@NoahMichaelZ 9 ай бұрын
@@JEEVI-y2k ah i get what you meant by that. yes I'm from france. you also???
@funatsun
@funatsun 2 ай бұрын
​@@NoahMichaelZ hii bro,i got an error in javac hello.java i checked the code also...and i didnt got hello.class? at 8:42
@SalakotPhilippines
@SalakotPhilippines 9 ай бұрын
Thank you Navin Reddy my forever teacher since 2015
@_I_like_kebeb
@_I_like_kebeb 8 ай бұрын
you are amazing, I have been learning Java for 1 year but now someone explained it correctly :D
@konradbartczak6083
@konradbartczak6083 Жыл бұрын
Cool content. I subscribed. Up to java 8 we could only install JRE to run purpose. But for java 9 everyone has to install the whole JDK.
@mukeshmgm7335
@mukeshmgm7335 Жыл бұрын
Greatest Tutorial Ever In KZbin.....
@shariqsaiyed8001
@shariqsaiyed8001 11 ай бұрын
Literally, The way you explained !! I'm your fan!!
@robertjr8205
@robertjr8205 Ай бұрын
This was the greatest explanation ever! Thank you!
@fadisalameh3368
@fadisalameh3368 4 ай бұрын
super explaining I think, you are the best java teacher
@sivaranjanis9019
@sivaranjanis9019 Ай бұрын
Great Navin. Very Useful . Thank you for such wonderful video
@abdulkarimyahuza6596
@abdulkarimyahuza6596 10 ай бұрын
Sir, thank you for the explicit explanation❤❤❤❤
@abdikhabirmohammed455
@abdikhabirmohammed455 8 ай бұрын
Thank very much for your simple and understandable explanation, indeed, it's wonderful
@pavi.R
@pavi.R 2 ай бұрын
If I type `javac hello.java` and press enter, my class file is not created instantly. However, if I run the program and then type `javac hello.java` again, I can see the class file is created. Why isn't it created instantly as shown in the video?
@Elevated2363-l8z
@Elevated2363-l8z 3 ай бұрын
This is amazing you have taught me so much
@pranavsharma5395
@pranavsharma5395 Жыл бұрын
sir kya badhiya bataya hai apki english bhi bahut simple hai sab samjh aya or appne jo bataya mujhe bahut acha laga abb mai bhi placement lepaunga thanks 🙏✨
@vivan1310
@vivan1310 Ай бұрын
bro I love this man so much it is not funny
@devotionalsongs5673
@devotionalsongs5673 7 ай бұрын
This is amazing I am able to understand java now!
@techysam-bl9mk
@techysam-bl9mk 9 ай бұрын
Beautifully explained - Kudos
@akashatote9830
@akashatote9830 Жыл бұрын
Thank you so much sir... really your explanation too good easily any one can understand...
@brunomiguel6603
@brunomiguel6603 Жыл бұрын
Hi @Telusko, I hope you are doing well. First of all, thank you for this contents, however I have got confused when explained about the main method… when we use JSE we have a main method but in Jakarta we don’t have the main verb because is web application…
@tiagosansaodev
@tiagosansaodev 9 ай бұрын
Congratulations, your explanation is the best! Keep going.
@actandrepeat
@actandrepeat Жыл бұрын
In summary: The compiler compiles Java source code into byte code and the byte code (machine code) is then read by the JVM, processed and converted into instructions for the respective OS to understand.
@bandisanjana634
@bandisanjana634 Жыл бұрын
Thanks! 😊
@IMMWICKED
@IMMWICKED Жыл бұрын
Bro needs to pin this comment bc the beginning was a bit hard for me to follow but this comment really helped everything click together. Thank you!
@naseddinoufallah628
@naseddinoufallah628 11 ай бұрын
i like your explanation , my problem is english i will improve my english and my talk , for hear you again
@art19kp04
@art19kp04 6 ай бұрын
Very sharp explaining salute 🫡 sir
@yitingchen8278
@yitingchen8278 Жыл бұрын
JDK contains JRE, and JRE contains JVM. JVM need to build for particular OS.
@roshni4022
@roshni4022 18 күн бұрын
execellent explanation sir
@akankshamishra1262
@akankshamishra1262 9 ай бұрын
Thank you so much, your explanation is very good.
@omagency2771
@omagency2771 2 ай бұрын
sir very nice explanation ,thank you sir
@girlwhocodesandlifts
@girlwhocodesandlifts Жыл бұрын
Hi, is there any way I can see these things(JRE, JVM etc) in action? Any way to know what's happening at JRE/JVM level when I run a java program/application?
@PalG75
@PalG75 3 ай бұрын
Different functions are available inside folders of jdk/conf These functions execute all these
@alejandrog5529
@alejandrog5529 5 ай бұрын
Amazing, greetings from Colombia
@higiniofuentes2551
@higiniofuentes2551 6 ай бұрын
Thank you for this very useful video!
@swathim3988
@swathim3988 8 ай бұрын
Best teacher❤
@lionarpotter9535
@lionarpotter9535 Жыл бұрын
Sir after running Java code (Hello.java) successfully,the byte code( Hello class) is not appearing in left top corner sir why and bcoz of that it shows no class name as hello world
@ajitkumarsaha4074
@ajitkumarsaha4074 Жыл бұрын
Mine also not appearing but when appeared..it printed hello world but after that whatever I want to print it is printing only hello world
@mohammedabdulkarim9878
@mohammedabdulkarim9878 Жыл бұрын
Facing same challenge like yours..
@aashrithreddy4921
@aashrithreddy4921 Жыл бұрын
Mee too
@hondaxblade2127
@hondaxblade2127 Жыл бұрын
I think the file exist but it is hidden by vs code, check it in vs code settings
@mohammedabdulkarim9878
@mohammedabdulkarim9878 Жыл бұрын
@@hondaxblade2127 Okay, lemme give a try..
@durgaraoponnuru17
@durgaraoponnuru17 Жыл бұрын
Hi Sir, Thanks for your videos. I have a doubt, how can system have JRE and JVM without installing JDK. As per my knowledge, when we download and install JDK, JVM and JRE will be created.
@saintjonny
@saintjonny 6 ай бұрын
correct, i also read this, jvm comes with the jdk not preinstalled with the os
@Fredy-v3n
@Fredy-v3n Жыл бұрын
In my research I found: a 'static block' executing before 'main' method, So when we compile the code to byte and run through the JVM, the jvm look for main method or static block first?
@haripriya8034
@haripriya8034 Жыл бұрын
Sir I got confused at the end. That our friend's machine only have JRE and JVM. JDK is not required. Thank you so much sir for this beautiful content.....
@johnnwick733
@johnnwick733 Жыл бұрын
JRE ( which contains JVM) is only required for executing byte code.
@nubgaming9776
@nubgaming9776 5 ай бұрын
public static void main(String[ ] args){ // code ..} or public static void main(String args[ ]){ // code ..} is both correct ?
@Telusko
@Telusko 5 ай бұрын
Yes
@uday2159
@uday2159 Жыл бұрын
1:48 I don't understand what u are talking about Later, I understand it🙂
@Jelvix
@Jelvix 4 ай бұрын
Thank you for this video! It's very helpful, especially for beginners. We also created a video on a similar topic, but we talk about the key differences between Java and Python
@ishitadas
@ishitadas 3 ай бұрын
Hi Sir, I have a problem. My class is not getting created and I am unable to find why it is Can you please help me
@suhashm5499
@suhashm5499 11 ай бұрын
Hi Sir, from past month i am asking this doubt,plz do reply.My conecern is that is this course for absolutel beginners!!! I need to start from very scratch because i didn't even know what is public static void main ..so plz do reply for my query
@Exploreyourself1234
@Exploreyourself1234 11 ай бұрын
Yaa bro 😊 even I am the beginner. You can start dude.ALL THE BEST. 😊
@babugovindaraj6411
@babugovindaraj6411 2 ай бұрын
Ur great sir🎉
@thanhtran-wy5wr
@thanhtran-wy5wr Жыл бұрын
hello sir, where can i take the exercises to improve my skills? thank you so much 🥰
@codeblooded03
@codeblooded03 10 ай бұрын
hi sir when i give the run command it says " Error: Main method not found in class hello2, please define the main method as: public static void main(String[] args) or a JavaFX application class must extend javafx.application.Application " please tell me how to solve it.
@devrajdasari5546
@devrajdasari5546 5 ай бұрын
The error is because you can't run a Java file without main method. Public static void main(String[ ] args) { } Note : we can compile (javac) the Java code without main method, but we can't run the Java code without main method
@abhinaybandi44
@abhinaybandi44 2 ай бұрын
Umm i got a problem. I could not the extra file after typing javac Hello.java
@FrancesObeleEbubechukwu-yz7po
@FrancesObeleEbubechukwu-yz7po 2 ай бұрын
Very good sir 💯✨
@BinduVuppala
@BinduVuppala 9 ай бұрын
After compiling its not giving byte code, please respond
@HappyMishra-i7n
@HappyMishra-i7n 3 ай бұрын
Sir in windows it is showing error
@BluePaneTechnologies-nu4hh
@BluePaneTechnologies-nu4hh 5 ай бұрын
simply great.
@DeepakNamdeo-g1g
@DeepakNamdeo-g1g Жыл бұрын
Thanks you very much 😊
@akshaykadam8168
@akshaykadam8168 2 ай бұрын
kudos sir .!!
@manishsrivastava5611
@manishsrivastava5611 Жыл бұрын
Hi Sir , my byte code "hello.class was not created. Plz explain
@bhanuprakash5703
@bhanuprakash5703 Жыл бұрын
You need press ctrl + s in order to save the code you have written in the file. then execute javac command. hope it works 🙂
@bandarurahul4144
@bandarurahul4144 Жыл бұрын
​@@bhanuprakash5703thankyou
@pranavgarg3301
@pranavgarg3301 7 ай бұрын
​@@bhanuprakash5703 thanks it worked
@CoffeeGuy2327
@CoffeeGuy2327 6 ай бұрын
Hi, I was trying to run the code using javac Hello.java but I get this error unnamed classes are a preview feature and are disabled by default. public static void main (String a[]) (use --enable-preview to enable unnamed classes) Anyone knows how to fix this? Just beginning to learn coding through this channel. Thanks!
@CoffeeGuy2327
@CoffeeGuy2327 6 ай бұрын
*UPDATE* All goods now. I was able to search it up in google. I just have to enable preview it. Thanks!
@NiharikaENneha
@NiharikaENneha 7 күн бұрын
How to fix this?
@rannnniiiiii
@rannnniiiiii 2 ай бұрын
why did you sir suddenly remove 'ln' from 'println' ?
@dragondark8633
@dragondark8633 5 ай бұрын
awesome man keep it up
@sumiluckymikkubasant
@sumiluckymikkubasant 3 ай бұрын
May i know why the class is not getting created
@jatinasthana5318
@jatinasthana5318 4 ай бұрын
sir is jvm is pre installed with the os of any computer or when we download java (from oracle ) then jvm comes with it?
@sandrawanja1793
@sandrawanja1793 4 ай бұрын
It doesn't come preinstalled but rather it comes after installing java
@beqari
@beqari Жыл бұрын
Well I've never had problem with printing Hello World in programming, seems like people have experienced same thing here and No help... :D it just cant find class with name Hello
@navdeepagrawal9201
@navdeepagrawal9201 10 ай бұрын
Why jdk required in our machine, if not required in friend's machine
@shaikabdulazeez4778
@shaikabdulazeez4778 Жыл бұрын
Hi sir . I wrote java program like u same but in terminal when i compile code error:- could not find or load main class Hello . What the problem can you tell me 🙂.
@bandarurahul4144
@bandarurahul4144 Жыл бұрын
Bruh did you got the solution cause I too got the same prblm?
@puneethnaika
@puneethnaika Жыл бұрын
Suppose Android app is made using Java. Does our Android phone have jvm installed to run the application.
@TrendBomb-f8p
@TrendBomb-f8p 10 ай бұрын
Thank u bro❤
@lucasemanuel3373
@lucasemanuel3373 4 ай бұрын
Awesome.
@gaddamgowriswari126
@gaddamgowriswari126 2 ай бұрын
Jvm abrevation please
@meenagachaitanya1306
@meenagachaitanya1306 Жыл бұрын
Sir we can write println also?
@sanketpawar7534
@sanketpawar7534 Жыл бұрын
yeah it's also used to print stmt in java , liittle diffrence is by using print it will print given stmt in same line, whereas println prints stmt in new line everytime
@geniusworld7484
@geniusworld7484 10 ай бұрын
very helpful
@ShivaniBathula
@ShivaniBathula Жыл бұрын
i didn't get a class file after compiling,what do i do
@BbbSss-qu3we
@BbbSss-qu3we 5 ай бұрын
Me same thing.. how to fix it ?
@mr.double.s909
@mr.double.s909 7 ай бұрын
You are amazing
@addankiadda2594
@addankiadda2594 3 ай бұрын
love from andhra
@mayanksrivastava7540
@mayanksrivastava7540 Жыл бұрын
sir how did you compile the code , i am not able to understand , it all happened a bit too fast
@sergiogarcia4697
@sergiogarcia4697 9 ай бұрын
awesome video!
@navaneethkp8691
@navaneethkp8691 2 ай бұрын
8:30 no new file is created in my system after compiling . Why ?(btw jdk version is 22)
@Ingeniouscraftyguy
@Ingeniouscraftyguy 9 ай бұрын
Hello sir I have a problem That is,I can't run my project when I type Java Hello it not works😢😢 I solve my problem
@gugulothusaritha1221
@gugulothusaritha1221 Жыл бұрын
How many platforms for writing java code ,vs and note pad NetBeans except these is there any
@niveshdhanaraj
@niveshdhanaraj 10 ай бұрын
Eclipse and IntelliJ is the most popular ides those are using by most companies
@akbarshohulmaszoda7918
@akbarshohulmaszoda7918 Жыл бұрын
oh brother, your accent makes me cry
@deepakjoy1862
@deepakjoy1862 4 ай бұрын
The Byte is not getting generated
@funatsun
@funatsun 2 ай бұрын
helo sir ,i got an error in javac hello.java i checked the code also...and i didnt got hello.class? at 8:42
@kapilsoraganvi8234
@kapilsoraganvi8234 Ай бұрын
I am Facing a problem with running the code my class is not created after running the code please help me with it
@srikanthyadav7265
@srikanthyadav7265 Ай бұрын
Save the code before compiling the code
@vempatinithin5591
@vempatinithin5591 Ай бұрын
sir i did't get hello class extra file plz can u tell
@gadekardnyaneshwar
@gadekardnyaneshwar Жыл бұрын
getting f0lllowing error, Hello.java:3: error: cannot find symbol public static void main(string a[])
@amitoshjaiswal6329
@amitoshjaiswal6329 Жыл бұрын
Hello.java:1: error: class, interface, enum, or record expected System.out.print(8); ^ 1 error What an error; "class, interface, enum, or record expected".
@dreamofdi427
@dreamofdi427 11 ай бұрын
Sir it is coming main not found in the file .define main method . please help me sir 🙏🙏🙏🙏🙏🙏
@muthinenidharmagokul7603
@muthinenidharmagokul7603 7 ай бұрын
when I tried to run the Java file it didn't generate the class file in the vs code, what may be the reason?, when I tried javac version it showed me the latest installed version as well
@yskarthik7853
@yskarthik7853 7 ай бұрын
You need to save the file before generating the class file.
@astech5825
@astech5825 4 ай бұрын
byte code is not coming sir
@anusyam3951
@anusyam3951 Жыл бұрын
I' m getting class not found exception
@naveenchowdarymaddineni6087
@naveenchowdarymaddineni6087 9 ай бұрын
hi sir, i tried to compile i got no errors and also did not got class file. can you help why is that.
@rohitpal73
@rohitpal73 7 ай бұрын
Same getting code runned but not getting class file
@katruya
@katruya 2 ай бұрын
Heresy! Putting the opening brace on the next line. IllegalCodeStyleException
@jeelpatel54
@jeelpatel54 Жыл бұрын
sir i have an issue vs code says hello.java is non -project file what should i do?
@CrypTechLaw
@CrypTechLaw 11 ай бұрын
Sir, I am not able to compile. It is showing error. //PS D:\Java Programming learn> java Hello Error: Could not find or load main class Hello Caused by: java.lang.ClassNotFoundException: Hello class Hello { public static void main (String a[]) { System.out.print("Hello World"); } }
@Exploreyourself1234
@Exploreyourself1234 11 ай бұрын
Bro in system "S" Must be capital. I think every thing is good. Once again try it bro.
@parvezshaik8123
@parvezshaik8123 10 ай бұрын
Inculcate the habit of keeping the names of both java file and class name the same. If your file name is Helloworld.java then name your class as Helloworld class Helloworld { public static void main (String a[]) { System.out.print("Hello World"); } } It will give the output
Complete Java Developer Course Batch-3
0:57
Telusko
Рет қаралды 181 М.
#5 Variables in Java
11:45
Telusko
Рет қаралды 385 М.
Стойкость Фёдора поразила всех!
00:58
МИНУС БАЛЛ
Рет қаралды 6 МЛН
Watermelon magic box! #shorts by Leisi Crazy
00:20
Leisi Crazy
Рет қаралды 81 МЛН
Just In Time (JIT) Compilers - Computerphile
10:41
Computerphile
Рет қаралды 273 М.
Harsh Truth of Java in 2024! Ft. Ultimate Java Developer @Telusko
28:46
Learn Java in 15 Minutes (seriously)
19:50
ForrestKnight
Рет қаралды 71 М.
#65 What is Interface in Java
8:03
Telusko
Рет қаралды 212 М.
#3 First Code in Java
11:17
Telusko
Рет қаралды 527 М.
JVM Anatomy 101
55:48
JetBrains
Рет қаралды 20 М.
#6 Data types in Java
12:19
Telusko
Рет қаралды 309 М.
Стойкость Фёдора поразила всех!
00:58
МИНУС БАЛЛ
Рет қаралды 6 МЛН