My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

Why we don't have to call the variables(in method perimeter) length and breadth again like we used to do in C?

Manish pamnani's photo
Manish pamnani
·Jun 17, 2017

Class Rectangle

def initialize (length, breadth)

    @length = length

    @breadth = breadth

end

def perimeter

    2 \* ( @ length + @ breadth)

end

end