Java中Console类别的格式字符串语法是什么。。。
题目为Given:1.publicclassLineUp{2.publicstaticvoidmain(String[]args){3.doubled=12.345;4....
题目为
Given:
1. public class LineUp{
2. public static void main(String[] args){
3. double d = 12.345;
4. //insert code here
5. }
6. }
Which code fragment, inserted at line 4, produces the output |12.345|?
A. System.out.printf("|%7d| \n", d);
B. System.out.printf("|%7f| \n", d);
C. System.out.printf("|%3.7d| \n", d);
D. System.out.printf("|%3.7f| \n", d);
E. System.out.printf("|%7.3d| \n", d);
F. System.out.printf("|%7.3f| \n", d);
答案:F
|%7.3f| 是什么意思呢? 展开
Given:
1. public class LineUp{
2. public static void main(String[] args){
3. double d = 12.345;
4. //insert code here
5. }
6. }
Which code fragment, inserted at line 4, produces the output |12.345|?
A. System.out.printf("|%7d| \n", d);
B. System.out.printf("|%7f| \n", d);
C. System.out.printf("|%3.7d| \n", d);
D. System.out.printf("|%3.7f| \n", d);
E. System.out.printf("|%7.3d| \n", d);
F. System.out.printf("|%7.3f| \n", d);
答案:F
|%7.3f| 是什么意思呢? 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询