0

How should I understand this java class syntax? What are must following rules when extending AbstractA?

public abstract class AbstractA<I extends AbstractB> extends AbstractC<I>{}

The following are my understandings:

Assume "A" is subclass of AbstractA, "B" is subclass of AbstractB.

  1. AbstractA has class holder I.
  2. A extends AbstractA<I>, where I could be AbstractB itself, or abstract class B, or regular B.
  3. Both A and I placeholder is also children of AbstractC.

Am I missing anything?

Daniel Lawton
  • 416
  • 3
  • 9
  • 30
user2734550
  • 952
  • 1
  • 12
  • 35
  • You are using some terminology that seems to be not the standard in Java, such as "class holder" and "placeholder". Can you explain what they mean? Also, what do you mean by `or abstract class B, or regular B`? Is `B` abstract or concrete? – Sweeper Sep 16 '19 at 07:30
  • I am new to java so the term I am using might be incorrect. Should class holder be called temporary data type? I thought it is a placeholder that require to be replaced with a different class in subclass inheritance. – user2734550 Sep 16 '19 at 16:47
  • No, it's not a placeholder. Read more about Java generics. Did the duplicate help? – Sweeper Sep 16 '19 at 16:49

0 Answers0