The documentation of Java specifies to use %n rather than \n for a newline.
As per the Oracle JavaSE Number documentation
A new line character appropriate to the platform running the application. You should always use %n, rather than \n.
If any, what is the prominent difference between both?