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.
Alternate to @mellamokb Answer
public class Caneirinho{
public static void contar(){
int i = 1;
String a = ” Carneirinho”,
b = ” pulando a cerca.”,
c = “s”;
for(i=1; i<=100; i++){ if(i==1){ System.out.println( i + a + b ); } else { System.out.println( i + a + c + b ); Thread.sleep(1000); // thread wais for 1 sec ie 1000 milisecond } } } public static void main(String[] args){ contar(); // call contar() from main method } }//Carneirinho