I have a data structure that i would like to print on the output like a table.
i've usedSystem.Out printf method but the result is not good.
System.out.printf("%4s %-7s %-4s %-7s%n", "node", "node Ip", "Type", "subType");
System.out.printf("%2d %-7s %-12s %-21s%n", node.getNodeKey(),
node.getNodeIpAddress(),
node.getNodeType(),
node.getNodeSubType());
and the result is:
node node Ip Type subType
2 10.1.1.2 NODETYPE_WDM NODESUBTYPE_RROADM_2
0 NODETYPE_NONE NODESUBTYPE_NONE
is there any smart way to do this well?
Thanks a lot.