These are hands you want to blindside opponents with in cash games. Unlike tournaments, where winning 'too little' is always a thing to consider, in cash games you want to play this as if you're sitting on QJ or K 10. Don't immediate all-in, raise to around 3x (sometimes 4x on looser tables). Those that engage you, if they raise big on the flop may well have KK or AA but if you have instincts based on the amount they are raising that they have a lower pair play passive with them.
Do not fall for the trap of thinking these are autowin hands, they aren't.
It depends a lot on the circumstances of the game when you get a hand of QQ or JJ, the position on the table, the amount of chips you have, if you are in the bubble zone, etc ... you should consider these factors . But they are usually hands to play all in ...
I just call for both to see the flop. That are tricky cards. It can easily be killed by A or K. That is why I always see the flop before going all in except on freerolls, then I go all in with either of those.
I'd say if you're on the button and no one else raised or only a few called you can feel better bout going in but maybe try a strong raise instead and just see what happens, then you don't risk it all if they do have pocket A or K but you can still win big if they don't. It's a good hand but I've seen a good amount of players loss with it to a pair of A or K so be cautiously optimistic with it.