I Installed Third party module under app/code folder. I created another module under same app/code directory to override the third party module. I specified
<preference for="[Third party Name Space]\Block\File" type="[Name Space]\[My Module]\Block\File" />
in di.xml but still I cannot override the Block file of third party module.