Printing in a loop with a count
<p>I am reading a file and printing out the file. What I am doing is counting mismatched parenthesis. The code I have works and counts the braces correctly. But the problem is the  format will only print the count at the front of the line not right behind the braces. I only need the count to print when there is a brace. is there anyway to format the the print statement to the end of the line? Check where my "\n" statements are. I'm wondering if there is one where instead of a linebreak it appends to the the end of a line.</p>

<pre><code>                if (brace == '{')
                {
                    count++;
                    System.out.print("\n" + count);
                }
                else if (brace == '}')
                {
                    count = count;
                    System.out.print("\n" + count);
                    count--;
                    if (count &lt; 0)
                    {
                    count = 0;
                    }
                }

            }
                System.out.println(inputLine);
</code></pre>
