Logo 
Search:

Java Articles

Submit Article
Home » Articles » Java » FundamentalRSS Feeds

Protected Constructor

Posted By: Joshua Bouchard     Category: Java     Views: 5292

This article explains about protected constructor in java with example.

Protected constructor can be invoked only by code in a subclass or the same package. It is like public within the same package. It is more accessible than default.

Syntax of Protected Constructor

class clsName
{
     // Variable declaration
 
     protected clsName()
     {
     }

     // Methods
}


clsName is a valid identifier in java. It is a class name.
  
Share: 

 
 
 

Didn't find what you were looking for? Find more on Protected Constructor Or get search suggestion and latest updates.

Joshua Bouchard
Joshua Bouchard author of Protected Constructor is from Montreal, Canada.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!