Any Java class that you run directly must have a main method, which is the entry point, i.e., where the program starts when you execute the code.

public static void main(String args[])

Just rename your method contar() to main(String args[]) and it should work.

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *