That technique wll take input at runtime all right. Please count how often the if statement will run. Please also count how many inputs you need before the end of the if, which you do by counting the next() calls.
That is completely different code from what you had earlier, with different semantics. It looks as if you were guessing about different kinds of code, and guessing is always a bad idea. Don't create multiple Scanners reading System.in. Use one Scanner for System.in for the whole application and never close it.
Also, go through your loop and work out what happens to the loop variable (noOfElements) during the loop.
If you are trying to create an expression, why are you concatenating the whole thing into one String? Why don't you have classes for operators and operands and expressions? If you put the whole thing together into a String, you will have the same problem about breaking the String up later.