• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Difference between acess modifiers and modifiers?

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I will be thankful if any body clears my doubt.

Q] What is the difference between access modifiers and modifiers?

As per my knowledge access modifiers indicates visibility of a
class and it's members?

Why keywords final, static, strictfp, abstract, voltile, native,
synchronized are called modifiers?

Thanks in advance.

Regards,
Gopal.
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Access modifiers are keywords used to specify the declared accessibility of a member or a type. There are three access modifiers in Java: public, protected and private. However, there are four access controls (levels of access), the fourth being default or package level access (no modifier added). A class can only use public or default, while most methods and variables take all four.

Nonaccess modifiers modify the declaration of a member or a type. They can be used in addition to whatever access control there is on a class.
A class declaration can be modified with keywords final, abstract, or strictfp (note: you can't always mix nonaccess modifiers).
Methods and instance variables can also take transient, synchronized, native, strictfp, and static as modifiers.
 
keep an eye out for scorpions and black widows. But the tiny ads are safe.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic