it throws me error incompatible types: unexpected return value — return 10; please correct it make note where i am doing wrong code?

void means the method cannot return any value. if you wish to quit the application with exit code you can use System.exit().

   public static void main(String[] args) {
    System.exit(10);
}

refer Can a main method in Java return something?

Leave a Comment