Check out example codes for "java get html from url". It will help you in understanding the concepts better.

Code Example 1

URL oracle = new URL("http://www.oracle.com/");
        BufferedReader in = new BufferedReader(
        new InputStreamReader(oracle.openStream()));

        String inputLine;
        while ((inputLine = in.readLine()) != null)
            System.out.println(inputLine);
        in.close();

Learn ReactJs, React Native from akashmittal.com