1 / 8

Access specifier

Access specifier. Các thành phần truy xuất. Các attribute và method của lớp đó Các đối tượng thuộc lớp đó Các attribute và method của lớp khác. Public. Base b= new Base(); b.A. Yes. Class Base public int A Method M{A =5;}. Yes. Class Other Method O{A=6;}. Yes.

sauda
Download Presentation

Access specifier

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Access specifier

  2. Cácthànhphầntruyxuất • Các attribute và method củalớpđó • Cácđốitượngthuộclớpđó • Các attribute và method củalớpkhác

  3. Public Base b= new Base(); b.A Yes Class Base publicint A Method M{A =5;} Yes Class Other Method O{A=6;} Yes Class Child : Base Method C{A=6;}

  4. Private Base b= new Base(); b.A No Class Base privateint A Method M{A =5;} No Class Other Method O{A=6;} No Class Child : Base Method C{A=6;}

  5. Protected Base b= new Base(); b.A No Class Base protectedint A Method M{A =5;} No Class Other Method O{A=6;} Yes Class Child : Base Method C{A=6;}

  6. Internal Cho phéptấtcảcácloạitrongcùng 1 file asemblyđượctruyxuất File asemblelà file .exe(chươngtrìnhviếtra) hoặccác file .dll

  7. Internal Application A.exe Base b= new Base(); b.A Yes Class Base internalint A Method M{A =5;} Yes Class Other Method O{A=6;} Yes Class Child : Base Method C{A=6;} No No Application B.exe Base b= new Base(); b.A Class Child : Base Method C{A=6;}

  8. Protected Internal Application A.exe Base b= new Base(); b.A No Class Base protected internalint A Method M{A =5;} Yes Class Other Method O{A=6;} Yes Class Child : Base Method C{A=6;} No No Application B.exe Base b= new Base(); b.A Class Child : Base Method C{A=6;}

More Related