HI all, I have just come across this:
System.out.printf("Student %2d: %3d\n");
What does that ":" mean? I assume it is a kind of separator becasue that line prints something like this:
Student 1: 87
thanks

Recommended Answers

All 3 Replies

The colon and following space are just text which will be ouput along with the variable data which will be inserted in the string where the format specifiers are found (%2d and %3d).

thanks.
@stultuske, yes I know, but I am not really tha familiar with the documentation as yet, I find it rather confusing...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.