public Example() {
}
public static void main(String[] args){
String c = hi();
System.out.print(c);
}
public static String hi()
{
return "Hi";
}
}
As explained in the last reply., You just can't write the metod definintion anywhere you want. The other solution for your problem is to write a static function which can be directly called by the static function main() as shown above.