|
|
|
|
|
by Tiomaidh
5444 days ago
|
|
For debugging via print statements: public int echo(int x, String name)
{
System.out.println(name + ":\t" + x);
return x;
}
(I also have versions with only x as an argument, and with the other types).In use: this.setPreferredSize(new Dimension(getPreferredSize.getWidth(), echo(getViewportHeight(itemCount), "Viewport"));
In addition to sparing me from System.out.println verbosity, it's really useful in situations like the above where the value you want to print isn't bound to a variable. |
|