Bắt đầu ngayBắt đầu miễn phí

Multiple dispatch

Multiple dispatch is one of the unique features of Julia, and it will help you write really neat and efficient code. Earlier in this chapter, you wrote some code to check whether a variable had the correct type for a function. With multiple dispatch we can handle different input types more effectively.

In this exercise, you will write a function that uses multiple dispatch.

Bài tập này là một phần của khóa học

Introduction to Julia

Xem khóa học

Bài tập tương tác thực hành trực tiếp

Hãy thử làm bài tập này bằng cách hoàn thành đoạn mã mẫu này.

# Write the negative function
____ ____(____)
	____ ____
____
Chỉnh sửa và Chạy Mã