For example I have this code:
public class A
{
private void my_method(){
//do something
}
}
So how can I call that method for code below to use it? I saw in one example it was done like this:
public class A
{
public A {
my_method();
}
//some other code
private void my_method(){
//do something
}
}
But trying this gives me this error:
"Syntax error on token "public", class expected after this token"
And of course using advise in error, gives this error:
"The nested type A cannot hide an enclosing type" So it seems that code I saw is bad or somehow I'm doing something wrong. Anyone could explain how to do it properly in Java?