Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Rexx Inheritance

/* Main program */ 
st = .student~new 
st~StudentID = 1 
st~StudentName = 'Joe' 
st~Marks1 = 10 
st~Marks2 = 20 
st~Marks3 = 30 
say st~Total(st~Marks1,st~Marks2,st~Marks3)  

exit 0 
::class Person 
::class student subclass Person 
::attribute StudentID 
::attribute StudentName 
::attribute Marks1 
::attribute Marks2 
::attribute Marks3 
::method 'Total' 
use arg a,b,c 
return (ABS(a) + ABS(b) + ABS(c))

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.