This is a code block that is posted under the docs for the java.util.Formatter class on sun's site. Ive never seen the static keyword used in an import statement and Calendar is a class, abstract, but still a class not a package so why the added .*?
Code:// Format a string containing a date. import java.util.Calendar; import java.util.GregorianCalendar; import static java.util.Calendar.*; Calendar c = new GregorianCalendar(1995, MAY, 23); String s = String.format("Duke's Birthday: %1$tm %1$te,%1$tY", c); // -> s == "Duke's Birthday: May 23, 1995"




Reply With Quote