This is your answer-
The 301 redirect tells the user and search engine bots that the original web page has permanently moved to another location. A 301 status code is used when any page has been permanently moved to another location. Users will now see the new URL as it has replaced the old page.
A 302 redirect is a temporary redirect and directs users and search engines to the desired page for a limited amount of time until it is removed. It may be shown as a 302 found (HTTP 1.1) or moved temporarily (HTTP 1.0).