Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. class Foo<T extends Foo<T>> {
  2.  
  3. public void doXTo(T other) {
  4. Foo<T> f = other;
  5. f.doPrivateX(); // compiles
  6. other.doPrivateX(); // compilation error: doPrivateX is not accessible!
  7. }
  8.  
  9. private void doPrivateX() {
  10.  
  11. }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement