9 - Structs in Julia Flashcards

1
Q

Introduction to Julia

What is the basic structure of a struct?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Introduction to Julia

How can you create an object using a struct?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Introduction to Julia

How do you call the fields from a struct object?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Introduction to Julia

Are structs mutable or immutable?

A

immutable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Introduction to Julia

Is it possible for a struct to be mutable?

A

Yes, with the mutable keyword.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Introduction to Julia

Is it possible to restrict the data types that can be used in a struct?

A

Yes, use ‘ :: ‘

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Introduction to Julia

How can the field of a mutable struct be changed?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Introduction to Julia

With a mutable struct, what happens if you do not use the correct field type?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Introduction to Julia

Can a mutable struct have a custom constructor?

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Introduction to Julia

What is necessary for a constructor?

A

The ‘new’ keyword

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Introduction to Julia

How can a mutable struct be used with a function?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly