Learn how to declare a variable using both declarative and implicit typing.
- In the last video we saw how to create what we called…an auto property, but we didn't really explain…what it is or why you'd want to use it.…I generally like to teach it this way.…I want to show you how to make a traditional property…with a getter and setter on it…and then I think this one will make a little…bit more sense.…So the first thing I usually like to do…is make something from the Java perspective.…What you would do in Java is you would generally…create a private variable in this case it's going…to be an integer.…And you give it a name.…
In this case I'll use underscore Strength.…Underscore is just a convention you'll see used in…C sharp where you're telling everyone that's reading…your program that you're dealing with a private variable.…You don't have to call it underscore something.…And the underscore itself doesn't have any magical powers.…It's just a convention that I use.…I'll go ahead and close off this statement.…Now since it's private, nothing except this particular…class, character CS has access to underscore strength.…
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.