How do I move all operators to after all numbers given inside infix.txt which is 

```
"1.5 - 3.16 * 2.333 / 0.25 + 4.1"

```

Output should be: 

```
0.25 1.5 2.333 3.16 4.1 + - * /

```

Here's the code

```
public class SplitString{
   static boolean isOperator(char ch){
     return ch=='+' || ch=='-' || ch=='/' || ch=='*';
   }

   static boolean precedence(char a,char b){
     switch(a){
         case '+': return !(b=='-') || !(b=='*') || (b=='+') || !(b=='/');
        default : return false;
     }
   }

  static public void main(String... args){
       String filename="infix.txt";
       StringBuffer sb=new StringBuffer();
       try{
             java.util.Scanner sc=new java.util.Scanner(new java.io.File(filename));
             while(sc.hasNextLine()){
                   String s=sc.nextLine();
                   System.out.println(s);
                   java.util.Stack stack=new java.util.Stack();
                   String[] st=s.split("\\s");
                   for(String ss:st){
                         char ch=ss.charAt(0);
                         if(isOperator(ch)){
                               switch(ch){
                                     case '+': if (!stack.empty() || stack.peek().toString().charAt(0)=='+')
                                           stack.pop();
                                           else stack.push(ch);
                                           break;
                                     case '-': if (!stack.empty() || stack.peek().toString().charAt(0)=='-')
                                           stack.pop();
                                           else stack.push(ch);
                                           break;
                                     case '*': if (!stack.empty() || stack.peek().toString().charAt(0)=='*')
                                           stack.pop();
                                           else stack.push(ch);
                                           break;
                                     case '/': if (!stack.empty() || stack.peek().toString().charAt(0)=='/')
                                           stack.pop();
                                           else stack.push(ch);
                                           break;        
                               }
                         }else sb.append(ss);
                   }
                     for(;!stack.empty();sb.append(stack.pop()));
                     System.out.println(sb.toString());
             }
       }catch(Exception e){ e.getMessage();}                    
  }
}

```