Interviewer And Interviewee Guide

Ruby Developer Interview Question:

Tell me what is the difference between calling super and calling super()?

Submitted by: Muhammad
A call to super invokes the parent method with the same arguments that were passed to the child method. An error will therefore occur if the arguments passed to the child method don't match what the parent is expecting.

A call to super() invokes the parent method without any arguments, as presumably expected. As always, being explicit in your code is a good thing.
Submitted by: Muhammad

Read Online Ruby Developer Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.