Optimizing program to output all numbers summing to 100
General remark

Short code (as in less space in code) is not necessarily easier to read, nor does it need to be faster. You can try to keep removing unnecessary stuff until it is as short as possible, but please keep it readable. Writing code is hard, reading code is twice as hard. 

Short answer


Online, everywhere, in books. "Effective Java" for example. Read about algorithms and data structures. Look at how others solved problems. Read many code reviews.
Use a profiler and measure where your code is slow.


Longer answer


You need to expose yourself to a lot of code, and start with simple problems. See how you would solve it, then look how others solved it and try to improve upon it.
For this case: try to represent your operators and operands in such a way that you can evaluate them in Java.  Generally: use the correct data structures and algorithms. That is most important. Then, try to use the right types. String concatenation is generally a lot slower in execution time than integer math. 


Example

For example to evaluate and generate the permutations (using recursion just because we can :):

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class MakeHundred {

    private static int LENGTH = 8;

    // Encode the operators in a enum. We use the factor to implement
    // easier operation later on, and the display String as well.

    enum Operator {

        PLUS(1, "+"), MINUS(-1, "-"), NONE(0, "");

        private int factor;
        private String display;

        public String getDisplay() {
            return display;
        }

        Operator(int factor, String display) {
            this.factor = factor;
            this.display = display;
        }

        public int getFactor() {
            return factor;
        }

    }

    /**
     * Class for keeping a permutation, with is an list of operators which will be
     * used to create a sum, eg. 1 op1 2 op2 3.
     * 
     * @author RobAu
     *
     */
    public static class Permutation {

        Operator[] operators;

        // Just one operator
        public Permutation(Operator operator) {
            this.operators = new Operator[] { operator };
        }

        // Copy the given permutation, append the given operator
        public Permutation(Permutation sourcePermutation, Operator operatorToAppend) {
            this.operators = Arrays.copyOf(sourcePermutation.operators, sourcePermutation.operators.length + 1);
            this.operators[sourcePermutation.operators.length] = operatorToAppend;
        }

        @Override
        public String toString() {
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i &lt; operators.length; i++) {
                sb.append(i + 1);
                sb.append(operators[i].getDisplay());
            }
            // append the last digit
            sb.append(operators.length + 1);
            return sb.toString();
        }

        public int evaluate() {
            int index = 0;
            int currentNumber = 0;
            int total = 0;

            // We start with a previous operator (+),
            // So the code becomes simpler.
            // 1+2 = 0 + 1 + 2.
            Operator operator = Operator.PLUS;

            while (index &lt; LENGTH) {

                currentNumber += (index + 1);

                // If there is no operator, we are making a bigger number.
                if (operators[index] == Operator.NONE) {
                    currentNumber *= 10;
                } else {

                    // We increate the total by adding the current Number
                    // and using the previously seen operator
                    total += currentNumber * operator.getFactor();
                    currentNumber = 0;
                    operator = operators[index];
                }
                index++;
            }

            // add the last number.
            currentNumber += index + 1;
            total += currentNumber * operator.getFactor();

            return total;
        }

        /**
         * Generate all permutation with length &lt;code&gt;length&lt;/code&gt;
         */
        public static List&lt;Permutation&gt; generate(int length) {
            return generate(null, length);
        }

        private static List&lt;Permutation&gt; generate(List&lt;Permutation&gt; permutations, int length) {

            List&lt;Permutation&gt; perms = new ArrayList&lt;&gt;();
            if (length == 1) {
                for (Operator o : Operator.values()) {
                    perms.add(new Permutation(o));
                }
            } else {
                for (Permutation p : generate(permutations, length - 1)) {
                    for (Operator o : Operator.values()) {
                        perms.add(new Permutation(p, o));
                    }
                }
            }
            return perms;
        }
    }

    public static void main(String[] args) {
        for (Permutation p : Permutation.generate(null, LENGTH)) {
            if (p.evaluate() == 100) {
                System.out.println(p);
            }
        }
    }
}


Including JVM startup this runs in:

real    0m0,088s
user    0m0,088s
sys 0m0,012s