I am not sure what you mean by
"I have written a code using External Methods."
However, you get that message because there is no main method in your class, so it cannot run on its own. You need to add a main method (see below), and also the remaining code to drive this class and actually do something.
public static void main(String[] args) {
}