Why though


#1

My code System.out.println("Battery level is at " + batteryLevel) keeps saying this

Droid.java:11: error: <identifier> expected
    System.out.println("Battery level is at " + batteryLevel);
                      ^
Droid.java:11: error: illegal start of type
    System.out.println("Battery level is at " + batteryLevel);
                       ^
Droid.java:11: error: ')' expected
    System.out.println("Battery level is at " + batteryLevel);
                                             ^
Droid.java:11: error: ';' expected
    System.out.println("Battery level is at " + batteryLevel);
                                               ^
Droid.java:11: error: illegal start of type
    System.out.println("Battery level is at " + batteryLevel);
                                                            ^
Droid.java:11: error: <identifier> expected
    System.out.println("Battery level is at " + batteryLevel);
                                                             ^
Droid.java:11: error: ';' expected
    System.out.println("Battery level is at " + batteryLevel);
                   

#2

Your compiler will point at where it can no longer continue, the actual mistake may be before that - the compiler has no information about what you want (other than the code you provide) and can therefore not say what or where the mistake is.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.