Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: Private access modifier

  1. #1
    Junior Member
    Join Date
    Dec 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Private access modifier

    can u please help me with Private access modifier?


  2. #2
    Member
    Join Date
    Nov 2013
    Location
    Bangalore, India
    Posts
    70
    My Mood
    Cool
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Default Re: Private access modifier

    What is the kind of help you require with private access modifier?. Please be specific.

  3. #3
    Junior Member
    Join Date
    Dec 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Private access modifier

    Quote Originally Posted by dineshj83 View Post
    What is the kind of help you require with private access modifier?. Please be specific.
    dude,i want to know about the basics of private access modifier with an example.....
    and please help me with primitive and non primitive data type(meaning of both)?

  4. #4
    Member
    Join Date
    Nov 2013
    Location
    Bangalore, India
    Posts
    70
    My Mood
    Cool
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Default Re: Private access modifier

    access modifier is not dependent on data types. Private access modifier as the name suggests is visible only within the class where its defined.

  5. #5
    Junior Member
    Join Date
    Dec 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Private access modifier

    i need more about private access modifier.....and please tell me the difference b/w primitive and non primitive datatype?

  6. #6
    Member andbin's Avatar
    Join Date
    Dec 2013
    Location
    Italy
    Posts
    443
    Thanks
    4
    Thanked 122 Times in 114 Posts

    Default Re: Private access modifier

    Quote Originally Posted by pksksit View Post
    i need more about private access modifier
    There's not much more about private access modifier. Private can be applied to constructors, methods (both instance and class methods), fields (again both instance and class) and inner/nested types.
    As already stated by dineshj83, private members are only visible within the class where it's used. And consequently, private members are never inherited by subclasses and thus private instance methods cannot be "overridden".

    Quote Originally Posted by pksksit View Post
    and please tell me the difference b/w primitive and non primitive datatype?
    Primitive types are only: boolean, byte, short, char, int, long, float and double. Each of these types uses a well known number of bits and contains a numerical value (apart boolean which is true/false). All other types are "reference" types.
    Andrea, www.andbin.netSCJP 5 (91%) – SCWCD 5 (94%)

    Useful links for Java beginnersMy new project Java Examples on Google Code

Similar Threads

  1. Replies: 21
    Last Post: November 27th, 2012, 10:58 PM
  2. Error writing to an array with the static modifier.
    By handuel in forum Collections and Generics
    Replies: 2
    Last Post: December 25th, 2011, 11:10 AM
  3. "illegal modifier for parameter sum; only final is permitted
    By etidd in forum Java Theory & Questions
    Replies: 3
    Last Post: February 11th, 2010, 07:51 AM
  4. Default Access (package access) confusion
    By gauravrajbehl in forum Java Theory & Questions
    Replies: 1
    Last Post: November 18th, 2009, 04:11 AM