There is no problem, this class should compile without errors. But if you want to see "Hello how are you" displayed on your standard output, you have got to have a main method.
So what you can do is either to change your withoutMain into a main method, which must match the following :"public static void main(
String args[])" (otherwise it won't be identified as the main method) or call the withoutMain method in the main method of this or another class:
public class RunIt {
public static void main(String args[]) {
trial.withoutMain();
}
}
W.
PS: By the way, your classname must start with a capital letter
public class Trial