Solution :
Any Java class that you want to run directly must have the main method, it is the entry point, i.e., the program starts with main() when you execute the code.
public static void main(String args[])
So your correct code should be as below :
public class MyCaneirinho {
public static void mycontar() {
int j= 1;
String x = " Carneirinho",
y = " pulando a cerca.",
z = "s";
for (j = 1; j <= 100;j++) {
if (j == 1) {
System.out.println(j + x + y);
} else {
System.out.println(j + x + y + z);
}
}
}
public static void main(String[] args){
mycontar(); // call mycontar() from the main method
}
} // MyCarneirinho