How can I left-align strings using String.format()?
Same way as with printf -- use a -
modifier in the format
System.out.format("%-10d%-32s%-16s%-16s%-32s", obj.getId(), obj.getBname(), obj.getAname(),obj.getLanguage(),obj.getPublication());
Just add hyphen -
in front of the number.