The FOUR access modifiers in Java

Veröffentlicht am: 20 August 2024
auf dem Kanal: void theCoder
19
0

An access modifier is a keyword that defines the visibility of a class, method or field inside a class different from itself... See? I don't need Google for definitions.
There are four access modifiers(keywords) namely "public", "protected", "" and "private". Each one of these has a different social tolerance:
public is the happy pappy extrovert.
protected is only extroverted to "her" friend package and followers.
default is not a fan of opening up to people outside "her" friend package.
private's only relations are within "her", mysterious and absurdly antisocial.

NOTE: All four of these are true to themselves and hold nothing back. The can'ts mentioned in here are only for direct access, you can still use private methods or fields inside public methods within the class to access them from outside.

Timestamps
00:00 Explanation and example
01:35 Method creation
02:33 Class and package setup
03:16 public access modifier
04:17 protected access modifier
05:29 default access modifier
05:47 private access modifier
06:40 Conclusion
07:17 Outro

BGM
Rude
   • [FREE] DRAKE x ASAKE x AFROBEAT TYPE BEAT ...  

Omerta
   • GUNNA TYPE BEAT X FUTURE TYPE BEAT - OMERT...  

Nerves
   • (Free) Future Type Beat - Nerves | Travis ...  

#java #javaprogramming #coding #intellij #accessmodifier


Auf dieser Seite können Sie das Online-Video The FOUR access modifiers in Java mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer void theCoder 20 August 2024 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 19 Mal angesehen und es wurde von 0 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!