Learn to create custom-defined types for your Julia program.
- Although Julia doesn't support creating classes … like other object-oriented languages, … you can create custom types. … And we'll examine how to do that in this example. … So let's go ahead and open up the types start file. … The struct keyword is used to define a new type. … So to create a new custom type called MyType … I can write some code like this. … So use struct and then call it MyType … and then I can give it some fields. … So I'll give it a field1 and I'll define that … to be an integer. … And then field2 and I'll make that one a string. … And you get the idea. … And then use the end keyword to close off the struct. … So to instantiate this new type, … I can use it like a constructor … and pass values for the fields. … So I can make a variable named x … and I'll just instantiate my new type … and I'll give it some values like 10 and … just a sample string. … And then I can print my variable to the … stand it out … and I can access fields using dot notations … so I can write x.field1. …
- Using the Julia REPL tool
- Differences between Julia and other languages
- Variables and data types
- Numbers in Julia
- Defining and operating on strings
- Using built-in functions in Julia
- Conditional statements
- Using array functions
- String processing
Skill Level Beginner
Python Basics for Java Developerswith Deepa Muralidhar42m 53s Beginner
Programming Foundations: Algorithmswith Joe Marini1h 45m Beginner
What you should know1m 26s
2. Language Basics
3. Language Features
4. Control Structures
5. Data Structures
6. Julia Features
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.