Email address:
Password:
SCJP/OCPJP 1.6 certification
Practice Exams and Training

How it formats the given input


System.out.printf("12%1$s","13%1$s","14%1$s");

Basically, printf uses Java formatter syntaxes, which is what the java.util.Formatter class is for.


In the printf line in your post, you would see that there are three parameters. The first parameter contains the formatter pattern that reads the values of other parameters. I can explain each segment to you, but can you please tell me whether you have read and understood the formatter patterns ?

ExamLab © 2008 - 2024