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…
Author
Released
1/17/2019- 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
Duration
Views
Related Courses
-
Docker for .NET Developers with Visual Studio
with Lee Brandt46m 52s Intermediate
-
Introduction
-
Course overview2m 54s
-
Using the exercise files1m 50s
-
1. C# on the Mac?
-
C# for Mac development?3m 15s
-
Overview of the C# language3m 35s
-
-
2. Getting Started with C#
-
Understanding C# syntax2m 20s
-
Variables and types in C#16m 58s
-
Project rules6m 18s
-
Creating a class5m 1s
-
Auto-properties2m 15s
-
Encapsulation8m 15s
-
Constructors6m 54s
-
Random number method8m 1s
-
Generating the character3m 59s
-
-
3. Deeper into C#
-
Using the library7m 23s
-
Overriding ToString10m 22s
-
Using for loops4m 55s
-
Simple arrays7m 17s
-
Working with lists: Part 15m 23s
-
Working with lists: Part 27m 25s
-
Updating the ToString method3m 52s
-
Flow control9m 46s
-
Building and testing the app6m 13s
-
4. Creating a Mac App
-
Setting up the GUI project3m 46s
-
Customizing the controls3m 8s
-
Attribute inspector3m 48s
-
Creating Actions2m 20s
-
The view controller8m 34s
-
Adding a new text field2m 54s
-
Multiline text field2m 58s
-
Working with table views5m 53s
-
Table view outlets2m 28s
-
Finish the view controller3m 55s
-
-
Conclusion
-
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.
CancelTake 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.
Share this video
Embed this video
Video: Random number method