Hai,
I want to use a static constructor .Ofcourse, there may not be any use ,but i want to use it . It is showing compile time error "modifier static not allowed here" when running the following program.
I am expecting when the "r" object of class "Rama" is being instantiated at line6 and the constructor should be called.But why it is not happening? And how it can be syntactically wrong?
class Rama{
public static Rama(){
System.out.println("Rama");
}
public static void main(
String [] args){
Rama r=new Rama(); //line 6
}
}
Thanks,
Santosh N.