Learn Data Structures and Algorithms with Golang
上QQ阅读APP看书,第一时间看更新

The New method

The New method on the Order class assigns the properties from the priority, quantity, and product parameters for name and customerName. The method initializes the properties of the order as follows:

// New method initializes with Order with priority, quantity, product, customerName
func (order *Order) New(priority int, quantity int, product string, customerName string ){
order.priority = priority
order.quantity = quantity
order.product = product
order.customerName = customerName
}