The principle of res judicata is based on the need of giving a finality to judicial decisions. What it says…