Simple subnet calculator and parser I have started to learn Java for the past 20 days with no prior coding/comp science experience.

My brother gave me an idea to make a subnet calc/ping tool to enhance my knowledge and mentored through this.

Just wanted to know how can I upgrade this code and if I have used proper language idioms in this code. Any ideas to simplify/features for more learning would be appreciated.

import java.util.*;
import java.util.regex.Pattern;
import java.math.*;
import java.text.NumberFormat;
import java.text.ParseException;
import java.net.*;


public class example {

    public static void main(String[] args) {
        Scanner Scan = new Scanner(System.in);
        System.out.print("Enter IP: ");
        String IP;
        IP = Scan.nextLine();
        String Z = IP.split("\\/")[1];
        String Y = IP.split("\\/")[0];
        String[] parts = Y.split("\\.");
        String F1 = parts[0];
        String F2 = parts[1];
        String F3 = parts[2];
        String F4 = parts[3];
        int A = Integer.parseInt(F1);
        int B = Integer.parseInt(F2);
        int C = Integer.parseInt(F3);
        int E = Integer.parseInt(F4);

        {
            System.out.println(F1 + "." + F2 + "." + F3 + "." + F4);
        }
        String X = (IP.substring(IP.lastIndexOf("/") + 1)); {
            System.out.println(X);
        }
        int S = Integer.parseInt(X);
        double Bits = 32;
        double TotalBites = Bits - S;
        double I = Math.pow(2, TotalBites);
        int D = (int)(I - 2); {
            System.out.println(D);
        }

        List &lt; String &gt; Hosts = new ArrayList &lt; String &gt; ();

        if (S &gt;= 24) {
            int val = (int) TotalBites - 0;
            String bitsda = stringMultiply("0", val);
            String bitstoconvert = "1" + bitsda;
            int decimal = Integer.parseInt(bitstoconvert, 2) - 1;
            //String bits = Strings.repeat("0", val);

            for (int IPF4 = E; IPF4 &lt;= decimal; IPF4++) {

                Hosts.add(F1 + "." + F2 + "." + F3 + "." + IPF4);
            }

        } else

        if (S &gt;= 16) {

            int val = (int) TotalBites - 8;
            String bitsda = stringMultiply("0", val);
            String bitstoconvert = "1" + bitsda;
            int decimal = Integer.parseInt(bitstoconvert, 2) - 1;
            //String bits = Strings.repeat("0", val);
            for (int IPF3 = C; IPF3 &lt;= decimal; IPF3++) {
                for (int IPF4 = E; IPF4 &lt;= 255; IPF4++)
                    Hosts.add(F1 + "." + F2 + "." + IPF3 + "." + IPF4);

            }



        } else

        if (S &gt;= 8) {

            int val = (int) TotalBites - 16;
            String bitsda = stringMultiply("0", val);
            String bitstoconvert = "1" + bitsda;
            int decimal = Integer.parseInt(bitstoconvert, 2) - 1;
            //String bits = Strings.repeat("0", val);

            for (int IPF2 = B; IPF2 &lt;= decimal; IPF2++) {
                for (int IPF3 = C; IPF3 &lt;= 255; IPF3++)
                    for (int IPF4 = E; IPF4 &lt;= 255; IPF4++)
                        Hosts.add(F1 + "." + IPF2 + "." + IPF3 + "." + IPF4);


            }
        }

        Hosts.forEach(host -&gt; pingIt(host));

    }

    public static void pingIt(String host) {
        try {
            String ipAddress = host;
            InetAddress inet = InetAddress.getByName(ipAddress);
            System.out.println("Sending Ping Request to " + ipAddress);
            if (inet.isReachable(5000)) {
                System.out.println(ipAddress + " is reachable.");
            } else {
                System.out.println(ipAddress + " NOT reachable.");
            }
        } catch (Exception e) {
            System.out.println("Exception:" + e.getMessage());
        }
    }


    public static String stringMultiply(String s, int n) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i &lt; n; i++) {
            sb.append(s);
        }
        return sb.toString();
    }
}
Splitting the input, parsing the parts, figuring the bits and filling the hosts list should all be seperate methods that return the results to main. 
Every method should perform a simple task. If you list the steps necessary to perform an action, each step should be a separate method. 
Commenting a methods purpose above it will help you and others understand it's inner workings. 
Bits and bites are not the same thing. 
 double totalbites = Bits - S; 
Also variable names should not start with a capital unless they are all capitals. 
Variable names like A, B, C, E, X, S are not very helpful. input1, input2,... and num1, num2,... would convey a clearer picture of these variables purpose. 
Use comments to explain the actions taking place.