Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Page page = mStory.getPage(0)
why at 0:25 we wrote "Page page = mStory.getPage(0);)" can somebody help me ?
Kevin Faust15,353 Points
Page page = mStory.getPage(0);)
mStory is the variable we created for the Story class. The Story class has a method called getPage() in the bottom of our Story class. We call that method, pass in a value from 0 to 6, and it will return the specified page that we wanted. In that method, it returns this:
So the number we pass in will the used to choose the array we want. In our Story class, we have an array of 7 pages. The first one is  and the last one is . After we get the page we want, we store it in Page page where "Page" is the class type and "page" is the variable.
Does that make sense?
Oh my this helped me a lot. Thanks for the question and answer!