Simple Vector - UndefVar Error

I am trying to learn Vector implementation in Julia. (1.7.1)
Following code gives :Candidate not defined" error.
The code has taken from the question here.
Stack overflow

What is wrong here? what is the correct way?

const max_candidates = 9
candidates = Vector{Candidate}(undef, max_candidates)

for i in 1:max_candidates
 println("Name of the candidate: ?")
 name = readline();
 println("Votes on him: ?")
 votes = parse(Int, readline());
 candidates[i] = Candidate(name, votes)
 println("Thank you, let us move to the next candidate.")
end

Means exactly what it says: you hadn’t defined Candidate yet when you executed this code. It’s presumably supposed to be some kind of struct?

See Please read: make it easier to help you

yes, missed the struct part. Fixed it by declaring it. Thanks.

mutable struct Candidate
   name::String
   votes::Int8
end