I am working through some tutorials on formatting numbers:
I am trying to use scrapbook. I can't seem to get the result I am wanting from System.out.println("Hello world")...I get null. To be specific I am trying to inspect:
int i = 461012;
System.out.format("The value of i is: %d%n", i)
In this case I get:
Something tells me that System.out.format can't work in a scrapbook. Is there a way without writing a main and running as java?
It seems that the format method returns the PrintStream (allowing you to chain method calls), and the return value is being printed.
You would get the output you're looking for, if you use the String.format() method, since that'll return the formatted String.