LoslegenKostenlos starten

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.

Diese Übung ist Teil des Kurses

<Kurs>Introduction to Julia</Kurs>
Kurs ansehen

Interaktive praktische Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Write the negative function
____ ____(____)
	____ ____
____
Code bearbeiten und ausführen