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

php - trouble displaying mysqli database results in correct order -

depending on nth recurrence of job in control M -

sql server - Cannot query correctly (MSSQL - PHP - JSON) -