40 is too many, Pakistan will buy 24 J35A at most. china is also not likely to transfer J35A technology.
The J35A carries the mission of competing head-to-head or even air combat showdown with the F35A on a global scale (since the likelihood of China's direct participation in the war is very low, the J20's mission is deterrence). China will not transfer J35A technology to any country.
Until Pakistan shoots down Rafale, I remain skeptical about J35A joining PAF anytime soon. Now I have changed my mind as India is bound to give up its illusions about Rafale,AMCA,Su57 and opt for F35 now. Then it makes sense to let Pakistani pilots acquire and familiarize themselves with the J35A as soon as possible.