gpt4 book ai didi

Java:使用 Eclipse

转载 作者:行者123 更新时间:2023-12-01 23:03:36 25 4
gpt4 key购买 nike

public String toMilitary()
{
return String.format("%2d:%2d:%2d", hour, minute, second);

}

此代码出现以下错误:

The method format(String, Object[]) in the type String is not applicable for the arguments (String, int, int, int)

此外,增强型 for 循环和变量参数显示错误。

我的编译器有问题吗?我应该重新安装它吗?

最佳答案

否(除非您真的有一个旧编译器),转到您的项目属性(右键单击),转到Java编译器并设置编译器合规性level 大于 1.5

关于Java:使用 Eclipse,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23159328/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com