public static void convertStringToInt(String inputString) 
    {
        inputString = "-90";
        
        if(inputString == null || inputString.length() == 0)
        {
            System.out.println("String is empty...");
        }
        
        int result = 0;
        int value = 0;
        int negative = 0;
        
        if(inputString.charAt(0) == '-')
        {
            negative = 1;
        }
        
        for (int i = 0; i < inputString.length(); i++) 
        {
            if(negative == 1 && i == 0)
            {
                continue;
            }
            else
            {
                value = inputString.charAt(i) - '0';
                if (value < 0 || value > 9) 
                {
                    System.out.println("Invalid number!!!");
                    break;
                }
            }
            
            result = result*10 + value; 
        }
        
        if (negative == 1) {
            result = result * -1;
        }
        
        System.out.println("The converted string is: " + result);
        
    }