Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

What is the difference between the class modifier internal and not specifying any modifier?

 
Ranch Hand
Posts: 1545
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We can specify modifier internal. When no modifier is supplied the default modifier is internal .So what difference does it make if one specifies modifier internal or does not specify any modifier at all ?

Thanks
 
Saloon Keeper
Posts: 12165
258
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not true. The default access level depends on the target and where it is declared.

For instance, top level declarations are internal by default, but class and struct members are private by default, while interface members are public by default.

While you can rely on the defaults if you want, personally I find code easier to maintain if the author has clearly indicated their intent by using explicit access modifiers.
 
Monica Shiralkar
Ranch Hand
Posts: 1545
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
 
I got this tall by not having enough crisco in my diet as a kid. This ad looks like it had plenty of shortening:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic