Check out example codes for "how to find ip address". It will help you in understanding the concepts better.

Code Example 1

import java.net.InetAddress;
import java.net.UnknownHostException;
public class FindIPaddress {
	public static void main(String[] args) throws UnknownHostException {
		InetAddress a = InetAddress.getLocalHost();
		System.out.println(a.getHostAddress());	
	}
}

Learn ReactJs, React Native from akashmittal.com