How to resolve the algorithm Compound data type step by step in the NetRexx programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Compound data type step by step in the NetRexx programming language

Table of Contents

Problem Statement

Create a compound data type:

A compound data type is one that holds multiple independent values.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Compound data type step by step in the NetRexx programming language

Source code in the netrexx programming language

/* NetRexx */
options replace format comments java crossref symbols nobinary

class RCompoundDataType
  method main(args = String[]) public static
    pp = Point(2, 4)
    say pp
    return

class RCompoundDataType.Point -- inner class "Point"
  properties indirect -- have NetRexx create getters & setters
    x = Integer
    y = Integer

  method Point(x_ = 0, y_ = 0) public -- providing default values for x_ & y_ lets NetRexx generate intermediate constructors Point() & Point(x_)
    this.x = Integer(x_)
    this.y = Integer(y_)
    return

  method toString() public returns String
    res = 'X='getX()',Y='getY()
    return res

  

You may also check:How to resolve the algorithm Pernicious numbers step by step in the Raku programming language
You may also check:How to resolve the algorithm Yin and yang step by step in the SETL programming language
You may also check:How to resolve the algorithm IBAN step by step in the Ada programming language
You may also check:How to resolve the algorithm Egyptian division step by step in the Quackery programming language
You may also check:How to resolve the algorithm Ulam spiral (for primes) step by step in the PicoLisp programming language