Sync
This commit is contained in:
parent
6f050a029e
commit
776bba907c
3887 changed files with 59894 additions and 7280 deletions
17
Task/Inheritance-Multiple/COBOL/inheritance-multiple.cobol
Normal file
17
Task/Inheritance-Multiple/COBOL/inheritance-multiple.cobol
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
CLASS-ID. Camera.
|
||||
*> ...
|
||||
END CLASS Camera.
|
||||
|
||||
CLASS-ID. Mobile-Phone.
|
||||
*> ...
|
||||
END CLASS Mobile-Phone.
|
||||
|
||||
CLASS-ID. Camera-Phone INHERITS Camera, Mobile-Phone.
|
||||
ENVIRONMENT DIVISION.
|
||||
CONFIGURATION SECTION.
|
||||
REPOSITORY.
|
||||
CLASS Camera
|
||||
CLASS Mobile-Phone.
|
||||
|
||||
*> ...
|
||||
END CLASS Camera-Phone.
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
interface ICamera {
|
||||
// ...
|
||||
}
|
||||
|
||||
class MobilePhone {
|
||||
// ...
|
||||
}
|
||||
|
||||
class CameraPhone: MobilePhone, ICamera {
|
||||
// ...
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
/* NetRexx */
|
||||
options replace format comments java crossref symbols binary
|
||||
|
||||
class RInheritMultiple public
|
||||
method main(args = String[]) public static
|
||||
iPhone = RInheritMultiple_CameraPhone()
|
||||
if iPhone <= RInheritMultiple_Camera then -
|
||||
say -
|
||||
'Object' hashToString(iPhone) '['iPhone.getClass().getSimpleName()']' -
|
||||
'is a' RInheritMultiple_Camera.class.getSimpleName()
|
||||
if iPhone <= RInheritMultiple_MobilePhone then -
|
||||
say -
|
||||
'Object' hashToString(iPhone) '['iPhone.getClass().getSimpleName()']' -
|
||||
'is a' RInheritMultiple_MobilePhone.class.getSimpleName()
|
||||
say iPhone.snap()
|
||||
say iPhone.call()
|
||||
return
|
||||
method hashToString(that = Object) public static
|
||||
return '@'(Rexx that.hashCode()).d2x().right(8, 0)
|
||||
|
||||
class RInheritMultiple_Camera private interface
|
||||
-- properties follow...
|
||||
shutter = 'click...'
|
||||
-- method prototypes follow
|
||||
method snap() public returns Rexx
|
||||
|
||||
class RInheritMultiple_MobilePhone private interface
|
||||
-- properties follow...
|
||||
ringTone = 'ring...'
|
||||
-- method prototypes follow
|
||||
method call() public returns Rexx
|
||||
|
||||
class RInheritMultiple_CameraPhone private -
|
||||
implements -
|
||||
RInheritMultiple_Camera, -
|
||||
RInheritMultiple_MobilePhone -
|
||||
uses -
|
||||
RInheritMultiple_Camera, -
|
||||
RInheritMultiple_MobilePhone
|
||||
method RInheritMultiple_CameraPhone() public
|
||||
return
|
||||
-- method implementations follow
|
||||
method snap() public
|
||||
return shutter
|
||||
method call() public
|
||||
return ringTone
|
||||
Loading…
Add table
Add a link
Reference in a new issue