The mDNS specification states about Responses in Section 6:
" [...]the record rrclass must match the question qclass unless the qclass is "ANY" (255). [...]
A Multicast DNS Responder MUST only respond when it has a positive non-null response to send. "
As the specification states, the mDNS daemon must only respond when it has an answer for a query. Even when the daemon has a record that matches the name or the type of the record in the question, if the class of the record does not match, the daemon must not answer.
However, when JmDNS receives a query asking for a service with unknown class, it incorrectly responds to the query instead of ignoring it.
In contrast, both Avahi and Bonjour ignore the same query.