Thread: printf Problem
View Single Post
Old Jan 12th, 2007, 7:06 PM   #12
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 909
Rep Power: 3 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
I would be more than happy if someone could explain to me why that code compiles under Java 5. According to Sun's documentation, the following is the correct way to call printf:

Object[] args = { new String("Java is object oriented.") };
System.out.printf("|%s|%n", args);
titaniumdecoy is offline   Reply With Quote