Learn how to generate a random number in this video.
- In this video we're going to talk about methods.…A method is basically a function, they mean the same thing.…In object-oriented parlance though,…you say method rather than function.…So a function is just something that does work on data.…If you think about a variable and a property,…which are kind of also the same thing,…as a way to store information, a container for information.…That's great so you can store information.…But really most programs need to be able to process…information, they need to be able to do something…with that data to make it useful.…
And that's what methods do.…So I'm going to scroll down to the bottom…and I'm going to add a method here.…In this case, the method that I'm going to add…is going to be responsible for generating our random numbers.…So I'll go ahead and give myself a little bit of…room down here at the bottom.…Method definitions look a lot like properties…except they have a few extra parts to them.…So you still need public for you access modifier.…
This means that it can be accessed…
AuthorBruce Van Horn
- Exploring C# on a Mac
- Creating a reusable code library
- Classes and properties
- Loops, arrays, and lists
- Creating a console app
- Creating a command-line app
- Creating a Mac desktop app
- Creating a UI with view controllers and actions
Skill Level Beginner
1. C# on the Mac?
2. Getting Started with C#
3. Deeper into C#
4. Creating a Mac App
Next steps3m 14s
- 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.