Building on the code from the previous example
- at the package level scope, using the
var
keyword, create a VARIABLE with the IDENTIFIERy
. The variable should be of the UNDERLYING TYPE of your custom typex
. - in
func main
a. this should already be done- print out the value of the variable
x
- print out the type of the variable
x
- assign your own VALUE to the VARIABLE
x
using the=
OPERATOR - print out the value of the variable
x
b. now do this - now use CONVERSION to convert the TYPE of the VALUE stored in
x
to the UNDERLYING TYPE- then use the short declaration operator to ASSIGN that value to
y
- then use the short declaration operator to ASSIGN that value to
- print out the value of the variable