File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Difference between acess modifiers and modifiers? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Difference between acess modifiers and modifiers?" Watch "Difference between acess modifiers and modifiers?" New topic
Author

Difference between acess modifiers and modifiers?

V. Potluri
Ranch Hand

Joined: Mar 29, 2007
Posts: 36
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.
Stijn Janssens
Greenhorn

Joined: Sep 09, 2008
Posts: 12
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.


<a href="http://zerotreize.com/#/blog/java-certification-matters" target="_blank" rel="nofollow">Java Certification matters?</a><br /><a href="http://www.zerotreize.com" target="_blank" rel="nofollow">Zerotreize.com</a>
 
Consider Paul's rocket mass heater.
 
subject: Difference between acess modifiers and modifiers?