I have two string variables and a ticker. I am trying to print two lines on one line. It just won't work. I have tried so many different ways to do this. To rule out the possibility of an uninitialized string, I tried printing them on different lines ... this works.
This example works ... except that the output should be on the same line.
System.out.println(ticker); System.out.println(detail);
And the result:
IWM |0
When I try to put the output on one line in any of many ways, I get only a ticker ... the line with the details just does not print ... not for the console or for the file. Here are a few code examples that give the same result:
Attempt 1:
System.out.println(ticker.concat(detail));
Attempt 2:
System.out.println(ticker+detail);
Attempt 3:
StringBuffer sb = new StringBuffer(); sb.append(ticker); sb.append(detail); System.out.print(sb.toString());
Attempt 4:
System.out.print(ticker); System.out.println(detail);
In all of the above attempts, I get the following conclusion ... as if the part detail is ignored:
GOLD BBL SI
What can cause these symptoms? Is there a way to get two lines printed on one line?
fodon source share