collections - PriorityQueue source code initFromPriorityQueue why doing the type comparison -


i reading source code of priorityqueue, in private method initfrompriorityqueue, compared type of c priorityqueue.class, don't understand, how can not same since priorityqueue concrete class without subclass?

private void initfrompriorityqueue(priorityqueue<? extends e> c) {     if (c.getclass() == priorityqueue.class) {         this.queue = c.toarray();         this.size = c.size();     } else {         initfromcollection(c);     } } 


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -