Aggregation means a collection of properties which defines a class. Your QueueByAggregation demonstrates this because it has a member variable (or property/attribute) which is the previously defined LinkedList. The nature of the QueueByAggregation is determined by what it is composed of, rather than what it is natively.
Inheritance means a class is a type of a superclass. In this case, your StackByInheritance is a type of LinkedList. It can do anything a LinkedList can do, and may be treated as a LinkedList by other classes. The StackByInheritance doesn't have a LinkedList, like the QueueByAggregation, it simply is one.
Hope this helps
subject: what is the code trying to say between inheritance and aggregation?