I created a new file and code, but unable to execute the code.*
Repl link:
public class FloatingPoint {
public static void main(String[] args) {
float sampleFloatValue = 0.123456789f;
double sampleDoubleValue = 0.123456789;
System.out.println("Value as float: " + sampleFloatValue);
System.out.println("Value as double: " + sampleDoubleValue);
}
}
Java FloatingPoint.java
This is the error I get:
sh -c javac -classpath .:target/dependency/* -d . $(find . -type f -name ‘*.java’)
./FloatingPoint.java:9: error: class, interface, enum, or record expected
Java FloatingPoint.java;
^
1 error
exit status 1
I can only seem to run the code if I edit the Main. java file