No, in fact they
can be garbage collected, but only under specific unusual conditions. Specifically, the class(es) that use a given literal must first be
unloaded. (Or at least, eligible for unloading.) Otherwise that class definition will contain reachable references to the pooled string object. The pool itself doesn't prevent GC of the objects in the pool (that is, the objects on the heap which are referenced by the pool) - but the class(es) which
use the pooled instances usually have
other references which prevent GC.
As usual when string pooling is mentioned, this is far more information than you need to know for the exam.

So if this seems too complicated, don't worry - the exam is not going to ask you whether pooled strings can be garbage collected.