0
Does Java support to declare a method inside the static block?
Java static block
4 Answers
+ 1
like this ?
static{
x=0;
}
+ 1
i dont think you can, i dont see how we can access the method if its declared inside a static anon block like that.
why not using static method instead ?
static final String doMethod(){}
0
Hi!
static{
final String doMethod(){
//Code
}
}
0
Thanks Taste , will do like that way.