123456789101112131415



Question 1: public class LineUp {
public static void main(String[] args) {
double d = 12.345;
// insert code here
}
}

Which code fragment, inserted at line 4, produces the output | 12.345|?

1. System.out.printf("|%7.3f| ", d);
2. System.out.printf("|%7d| ", d);
3. System.out.printf("|%7f| ", d);
4. System.out.printf("|%3.7d| ", d);