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 3 of 3

Thread: Why cannot the class be protected?

  1. #1
    Member
    Join Date
    Mar 2011
    Posts
    114
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Why cannot the class be protected?

    Why canít we make protected class when we can make default class which is more restricted ?

    Ex :

    Public class A {} complies well
    Class A {} complies well
    Protected class A {} compilation fails. Why so ??


  2. #2
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 262 Times in 231 Posts

    Default Re: Why cannot the class be protected?

    About 18,700,000 results (0.24 seconds) from a popular search engine for your question.

  3. #3
    Junior Member psabbate's Avatar
    Join Date
    Aug 2012
    Posts
    20
    My Mood
    Amused
    Thanks
    0
    Thanked 5 Times in 4 Posts

    Default Re: Why cannot the class be protected?

    There is not such thing like a "protected" class ...
    Everyone wants to go to heaven ... but nobody wants to die

    Nissi Group, Servicios IT,
    DiseŮo Web, Desarrollo de Software, SEO,
    LinkedIn

Similar Threads

  1. protected Access Specifier
    By spark in forum Object Oriented Programming
    Replies: 14
    Last Post: August 5th, 2012, 03:13 PM
  2. How to create a password protected excel sheet....
    By ArunSRPM in forum Member Introductions
    Replies: 1
    Last Post: April 18th, 2012, 01:25 PM
  3. about access modifiers (abstract and protected)
    By Satyanvesh in forum Java Theory & Questions
    Replies: 12
    Last Post: February 1st, 2012, 11:43 PM
  4. Using Protected Methods, in a Java Library
    By WACman in forum Object Oriented Programming
    Replies: 2
    Last Post: March 10th, 2011, 04:42 PM
  5. Replies: 2
    Last Post: June 13th, 2009, 01:44 AM