Results 1 to 6 of 6

Thread: Difference between Access Specifier and Modifier in Java

  1. #1
    Join Date
    Dec 2009
    Posts
    41

    Difference between Access Specifier and Modifier in Java

    Hi Friend,

    I am IT student with lots of confusion about the java concept. I am little bit aware about the access modifier of the java programming language. But I don't what is the exact difference between Access Specifier and Modifier in Java. Is the Access Specifier is completely different than Access Modifier ? or what. Please let me know some difference among Access Specifier and Modifier of Java. I awaiting for your reply.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Difference between Access Specifier and Modifier in Java

    Hi,

    There are basically three type of access specifier are available in java and which are private, protected and public. These access specifiers are placed in front of each definition for each member in your class, whether it’s a data member or a method. Each Java access specifier controls the access for only that particular definition. This is a distinct contrast to C++, in which the access specifier controls all the definitions following it until another access specifier comes along.

  3. #3
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Difference between Access Specifier and Modifier in Java

    Hello friend,

    Access modifiers in Java specifies access to the java code. Java Access modifiers divided into four categories and which are protected, public, private, no modifier. Using ‘no modifier’ is sometimes also referred as ‘package-private’ or ‘friendly’ or ‘default’ access. The two levels are class level access modifier and member level access modifier. In public or in no modifier maximum two access modifiers are allowed.

  4. #4
    Join Date
    May 2008
    Posts
    2,297

    Re: Difference between Access Specifier and Modifier in Java

    Access Modifiers:
    The Access Modifiers of Java is basically essential to declare field. Using this access modifiers you can apply access modifier to variable, methods or class. The java classes can have Abstract modifier. This Abstract modifier sud divided into synchronized, native and abstract. The access modifiers categorized into protected, private, no modifier and public.

  5. #5
    Join Date
    Oct 2005
    Posts
    2,393

    Re: Difference between Access Specifier and Modifier in Java

    Java Access Specifier is works as super class of the non-Access Modifier and Access Modifier to specifies accessibility to java code.
    Java Access Modifier comprises four categories:
    • Default
    • Protected
    • Public
    • Private
    Java Access Specifier comprises three categories:
    • Private
    • Public
    • Protected

  6. #6
    Join Date
    May 2008
    Posts
    2,389

    Re: Difference between Access Specifier and Modifier in Java

    Hi friend,

    Java Access modifiers divided into to two main types which are as below:

    Class level access modifiers:
    This access modifiers is only allowed no modifier and public. If the java class 'no modifer' then it has access only to variables within same package. If the java class 'public' modifier then it has access to all variables of class.

    Member level access modifiers :
    This access modifiers is only allowed private, protected and public. If the java class 'public' modifier then it has access to all variables of in same class.

Similar Threads

  1. Difference between Java Class and Bean
    By Bottlenecked in forum Software Development
    Replies: 5
    Last Post: 01-02-2010, 01:28 PM
  2. What is the difference between Iterator and Enumeration in Java?
    By Karsenman in forum Software Development
    Replies: 4
    Last Post: 28-01-2010, 09:56 AM
  3. what is the difference between c and java?
    By Linoo in forum Software Development
    Replies: 5
    Last Post: 28-11-2009, 05:11 PM
  4. What is the difference between CORBA and Java RMI?
    By Triple-X in forum Software Development
    Replies: 3
    Last Post: 03-09-2009, 05:59 PM
  5. Replies: 5
    Last Post: 02-03-2009, 09:00 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,413,362.93047 seconds with 17 queries