Format.print();这个语句使用的问题.

mingjava 2002-12-02 12:35:54
public class Daikuan
{
public static void main(String[] args)
{
double prin;
double yinterests;
int years;

prin=Console.readDouble("your load mount:");
yinterests=Console.readDouble("the years interests(ues 7.5 for 7.5%):");
years=Console.readInt("the number of years:");

double y;
for(y=yinterests-0.01;y<yinterests+0.01;y+=0.00125)
{
double monthlyinterests=y/12;
double payment=prin*monthlyinterests/(1-(Math.pow(1/(1+monthlyinterests),years*12)));
Format.print(System.out,"with rate of 6.3%",100*y);
Format.print(System.out,"%%,your monthly payment is $%10.2f\n",payment);


}


}


}

在这段程序进行编译的时候提示 can not resolve symbol"Format"
请问是什么原因?
...全文
34 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
mingjava 2002-12-02
  • 打赏
  • 举报
回复
谁有Format类的源代码?
mingjava 2002-12-02
  • 打赏
  • 举报
回复
Daikuan.java:20: cannot resolve symbol
symbol : method print (java.io.PrintStream,java.lang.String,double)
location: class java.text.Format
Format.print(System.out,"with rate of 6.3%",100*y);
^
Daikuan.java:21: cannot resolve symbol
symbol : method print (java.io.PrintStream,java.lang.String,double)
location: class java.text.Format
Format.print(System.out,"%%,your monthly payment is $%
.2f\n",payment);
^
2 errors
还是返回这个错误!怎么解决?
retrieve 2002-12-02
  • 打赏
  • 举报
回复
你加入
import java.util.*;

试试

62,630

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧