How to hide a method of a Java class?

In fact, as to hide/make not available, some methods of the class?
For example, overwrite the public methods of the parent class:
public class MyLayout extends FrameLayout {

 public MyLayout(Context Context) {
super(context);
}

/**
 * HOW TO MAKE THIS METHOD UNAVAILABLE / CHANGE THE VISIBILITY ???
*/
@Override
 public void addView(View child) {
super.addView(child);
}
}

In C#, seen, did something like this:
//This is
public override string ToString() {}

//Changed this
private new string ToString() {}

And how in java to do a similar did not find. And in Android Studio, in the classroom library, here's an example Context, there are hidden methods that look like this:
/** @hide */
public boolean isAutofillCompatibilityEnabled() {
 return false;
}

And, accordingly, this method is not see though and public.
Hence the questions: how is it done and how to do the same?

And it's all for the tags in the comments (@hide {@link}, etc.)? If you write also says unknown tag.
March 19th 20 at 09:07
3 answers
March 19th 20 at 09:09
Solution
In Java, to change the visibility of the inherited method can not. There are several options. First, you can leave the override blank and to move the functionality to another location. Secondly, to do it right, you need more encapsulation, and use the tools of language to create an interface that offers only the necessary methods.
Annotations in the comments inside the Android API have a different meaning. For example, @hide says that the method is not designed for use outside the API.
By the way, Yes, the interface is great, thanks. - dandre.Bruen commented on March 19th 20 at 09:12
I have the feeling that inside the Android SDK nothing was designed. These public @hide methods - one more crutch. - Selina_Simonis commented on March 19th 20 at 09:15
March 19th 20 at 09:11
In a pinch you can make it just empty. I.e., with an empty body.
Only if in extreme...
Just then the class will be fairly easy to work:

5c9dce51dcebe649627215.jpeg
But if I write the library as the other person needs to understand this... - dandre.Bruen commented on March 19th 20 at 09:14
@dandre.Bruen, And you do what is needed? - Selina_Simonis commented on March 19th 20 at 09:17
March 19th 20 at 09:13
I want to add that in java the same to change the visibility of the inherited method is possible, but only in the direction of expansion. To narrow down really can't — it would be a violation of the principle Barbara Liskov.

But tags in comments is the javadoc markup. And such comments are not comments at all, and documentation.

Find more questions by tags Java