1
double t1 = System.currentTimeMillis();
double t2 = System.currentTimeMillis();
System.out.print("\n Tempo Total: "+ (t2-t1)/Double.valueOf(1000)+ " segundos");
When compiling the third line, corresponding to System.out.println
, makes a mistake:
Unresolved Compilation problem: The Operator / is Undefined for the argument type(s) double, Double
It is running normally, see: https://ideone.com/p9a7b3
– user28595
You can put the
import
s of this Java file?– Pablo Almeida
I’m a beginner. which are the Imports I should put and where should I put them, please? in your file have these: import java.util.; import java.lang.;&#A;import java.io. *; Put but did not work.
– Thiago Marques
I changed exactly nothing in your code, I just copied and pasted without the need for any import. Rode good.
– Sullyvan Nunes
That strange friends, here does not run at all.Da the same error. The Operator / is Undefined for the argument type(s) double, Double
– Thiago Marques
Exception in thread "main" java.lang.Error: Unresolved Compilation problem: The Operator / is Undefined for the argument type(s) double, Double
– Thiago Marques
I ordered the import because it could be that your Double was not the Java Double but another one that you imported unintentionally.
– Pablo Almeida
After reading the comment from @sullyvan.Nunes I decided to compile the original code and everything worked out too (example in Ideone). That said I’ve seen similar errors happening in Eclipse, Jaspersoft Studio, etc. I believe something in the build chain may be behaving differently than the standard Oracle compiler.
– Anthony Accioly
What is the Java version? This only works from Java 5 (released in 2004). If your Java is a more dinosaur version, it won’t even work.
– Victor Stafusa
Thanks guys, to using the eclipse is the java and the latest!.
– Thiago Marques
Yesterday was the day of weird mistakes. This is that other on the same day? Cosmic rays must have hit us ugly yesterday.
– Pablo Almeida