Is it possible to access the private static method within the object creation scope? Something like the below snippet.
class A {
private static void func(int x) {
/*Some Code here*/
}
}
and call from another context, something like this :
new A(){{
func(2);
}};
The intent here is to facilitate for addition of more calls to func(int)
, with a differnt argument for each call, or to put simpler, some sort of builder for the object of type A
.
Something like this :
new A() { {
func(2);
}
{
func(3);
}
// ...
};
Is this possible to achieve ?