Hi friends, welcome to tutors funny channel today. I am going to teach Java networks
First I am going to teach The machine IP address right how to get the the machine IP local machine IP address
So let's go to the file new project. I am going to select Java Java application
Click create here. We have to create here. We have to give as a IP address
I am going to create a project name as IP address Now your project has been created successfully here now here first what I am going to do is here very simple stuff
I am going to do here. We have first we have to write here is you have to write the
You have to import here is import Java net This is Java
Right you have to implement the namespace Java net. Okay Okay, all the names will be available here right after that what I am going to do is here first
We have to write the math method I need to address This is the this this is this is how we have to get the IP address of the machine, right
So you're right I need I Address right this also case-sensitive you have to write like this is the object. I am going to create here address
equal the same Dot Get block roast get low cost this class, right
Now what I am going to say retain the IP address, so you have right string Address
to host Equal This address Address Dot Get
Host address After that you have to write you have to print the address right so how to print the address you have to write here
What's the problem here? I Have to print this one right system dot
Out dot println This is a must right. Okay. Now here is address right
Now let's run and check what is the IP address of the machine Okay, so let's run and check what is the IP address of the machine
Okay, so let's run and check what is the IP address of the machine