In this video, dive deep into how you can protect your objects with the private keyword and open up and make them accessible with the public keyword.
- [Instructor] Let's talk about the difference … between public and private … and in a future video, we'll talk about protected … because it actually plays off … how extended and implements works. … Now, public and private … are the two main access modifiers you're going to use. … By default, our property here is public. … If we don't have any keyword in front of it, … which is where your access modifier goes, … this is public. … This is equivalent to us actually adding said default. … Now, one thing to keep in mind … is that the IntelliSense doesn't say … if it's public or private, … you just need to know that by default, … TypeScript is private, … which may be different than a lot of you coming from C#, … for instance, where by default, … it's actually public. … And I believe it's the same in Java … but don't quote me on that. … I haven't done Java in many years. … Now, public means we have access to everything. … So let's say we create my cat again. … You remember my cat Baby. … Good cat, miss her. …
Skill Level Intermediate
TypeScript: Upgrades and Featureswith Emmanuel Henri1h 15m Advanced
TypeScript for Node.js Developerswith Emmanuel Henri1h 2m Intermediate
1. Classes in TypeScript
2. Inheritance in TypeScript
3. Access Modifiers in TypeScript
- 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.