이 코드를 포맷 할 수없는 것 같습니다. 코드 여기나는이 코드를 작동시킬 필요가 있지만, 무엇이 잘못되었는지 알 수 없다. 그것은 System.out.format() 문제입니다
Exception in thread
"main" java.lang.Error: Unresolved compilation problem:
The method format(String, Object[]) in the type PrintStream is not applicable
for the arguments (String, int, double) at
org.lineware.learningjava.Root2.main(Root2.java:9)
됩니다 :
public class Root2 {
public static void main(String[] args) {
int i = 2;
double r = Math.sqrt(i);
System.out.format("The square root of %d is %f.%n", i, r);
}
}
어떤 Java 버전을 사용하고 있습니까? –
나는 버전 8입니다. – user3456442
버전 문제가있는 것 같습니다. IDE에 코드를 작성하고 있습니까? –