private and protected

private and protected

what is diffrence between private and protected ?

View Answers

November 14, 2011 at 4:20 PM

A private (variable, method or class) is only accessible in the class where it was declared while A protected (variable,method or class) is accessible to sub classes and classes in the same package as where they were declared.









Related Tutorials/Questions & Answers:
private and protected
private and protected  what is diffrence between private and protected
What do you understand by private, protected and public?
What do you understand by private, protected and public?   Hi, What do you understand by private, protected and public? thanks
Advertisements
In Java, what's the difference between public, default, protected, and private?
In Java, what's the difference between public, default, protected, and private?  In Java, what's the difference between public, default, protected, and private
Using Protected Access in JSP
specifiers: public, protected, private. We always declare access specifiers to be more accessible. That means we have declared anything as a private, then we can...Using Protected Access in JSP     
ModuleNotFoundError: No module named 'protected'
ModuleNotFoundError: No module named 'protected'  Hi, My Python... 'protected' How to remove the ModuleNotFoundError: No module named 'protected' error? Thanks   Hi, In your python environment you
Can a class be declared as protected?
Can a class be declared as protected?  Hi, Can a class be declared as protected? thanks   Hi, A class can't be declared as protected. only methods can be declared as protected. http://www.roseindia.net/java
java protected variables
java protected variables   Can we inherit the Java Protected variable..?   of course you can. But I think what you mean is "override"? Is tha so? There are some restriction
make a file password protected
make a file password protected  I am trying to write Java code for creating a file of any type (either text,csv,or any other format). What I need is : The file generated should be zipped and password-protected. When I try to open
private constructor
private constructor  can we extend from a class which is having private constuctor
What is the access scope of a protected method?
What is the access scope of a protected method?  Hi, What is the access scope of a protected method? thanks   Hi, In Java program, A protected method can be accessed by the classes within the package
Protected Java Keyword
Protected Java Keyword       protected is a keyword defined in the java programming language. Keywords... in java programming language likewise the protected keyword indicates
private method
private method  how can define private method in a class and using it in another class in a same package? my source code: class rectangle{ int...){ this.length=l; this.breadth=b; } private int calculate
private method
private method  how can define private method in a class and using it in another class in a same package? my source code: class rectangle{ int length,breadth; void show(int length,int bredth){ this.length=length
ModuleNotFoundError: No module named 'django-protected-files'
ModuleNotFoundError: No module named 'django-protected-files'  Hi...: No module named 'django-protected-files' How to remove the ModuleNotFoundError: No module named 'django-protected-files' error? Thanks   Hi
ModuleNotFoundError: No module named 'django-protected-files'
ModuleNotFoundError: No module named 'django-protected-files'  Hi...: No module named 'django-protected-files' How to remove the ModuleNotFoundError: No module named 'django-protected-files' error? Thanks   Hi
ModuleNotFoundError: No module named 'django-protected-media'
ModuleNotFoundError: No module named 'django-protected-media'  Hi...: No module named 'django-protected-media' How to remove the ModuleNotFoundError: No module named 'django-protected-media' error? Thanks   Hi
Java private constructor
Java private constructor  what is private constructor?what are the uses of writing private constructor in our program
Private Cloud Hosting
Private Cloud Hosting  Hi, What is Private Cloud Hosting? What are the benefits of Private Cloud Hosting? Thanks
private static final
private static final  Why there is necessary to make a variable private static final
Private variable of class
Private variable of class  Hi..... What keyword allows you to refer to private variables of a class in flex? Please give me an example for that Thanks  Ans: private keyword and this keyword
Maven Repository/Dependency: s3-wagon-private | s3-wagon-private
Maven Repository/Dependency of Group ID s3-wagon-private and Artifact ID s3-wagon-private. Latest version of s3-wagon-private:s3-wagon-private dependencies. # Version Release Date You can
udacity secure and private ai
udacity secure and private ai  Hi, I am beginner in Data Science... secure and private ai Try to provide me good examples or tutorials links so that I can learn the topic "udacity secure and private ai". Also tell me
ModuleNotFoundError: No module named 'mediagoblin-private'
ModuleNotFoundError: No module named 'mediagoblin-private'  Hi, My... named 'mediagoblin-private' How to remove the ModuleNotFoundError: No module named 'mediagoblin-private' error? Thanks   Hi
ModuleNotFoundError: No module named 'base-private'
ModuleNotFoundError: No module named 'base-private'  Hi, My Python... 'base-private' How to remove the ModuleNotFoundError: No module named 'base-private' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'mediagoblin-private'
ModuleNotFoundError: No module named 'mediagoblin-private'  Hi, My... named 'mediagoblin-private' How to remove the ModuleNotFoundError: No module named 'mediagoblin-private' error? Thanks   Hi
ModuleNotFoundError: No module named 'private-pypi'
ModuleNotFoundError: No module named 'private-pypi'  Hi, My Python... 'private-pypi' How to remove the ModuleNotFoundError: No module named 'private-pypi' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'PyTestGame_private'
ModuleNotFoundError: No module named 'PyTestGame_private'  Hi, My... named 'PyTestGame_private' How to remove the ModuleNotFoundError: No module named 'PyTestGame_private' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'kjkiss-private'
ModuleNotFoundError: No module named 'kjkiss-private'  Hi, My... named 'kjkiss-private' How to remove the ModuleNotFoundError: No module named 'kjkiss-private' error? Thanks   Hi, In your python
Private Java Keyword
Private Java Keyword       private is a keyword defined in the java programming language. Keywords... in java programming language likewise the private keyword indicates the following
password protected zip file creation exmpale coded neaded - JSP-Servlet
password protected zip file creation exmpale coded neaded  am able to create a zip file and able to read the file but password protection need please help
private and final - Java Interview Questions
private and final  what is the difference between private modifier and final modifier in java   Hi Friend, Private modifier indicates... private protects the class writer from external code. Thanks
What if the main() method is declared as private?
What if the main() method is declared as private?  Hi, What if the main() method is declared as private? Thanks   Hi, I have found... as private. Visit this link may help you for getting examples with syntax related
private equity data science jobs
private equity data science jobs  Hi, I am beginner in Data Science...: private equity data science jobs Try to provide me good examples or tutorials links so that I can learn the topic "private equity data science jobs"
Private vs Public Blockchain
Private vs Public Blockchain - Similarities and differences between two types... the Private and Public. These two types of Blockchain chains are used to develop applications for public and private network. Developer should learn
Private vs Public Blockchain
Private vs Public Blockchain - Similarities and differences between two types... the Private and Public. These two types of Blockchain chains are used to develop applications for public and private network. Developer should learn
ModuleNotFoundError: No module named 'django-private-chat'
ModuleNotFoundError: No module named 'django-private-chat'  Hi, My... named 'django-private-chat' How to remove the ModuleNotFoundError: No module named 'django-private-chat' error? Thanks   Hi
ModuleNotFoundError: No module named 'django-private-files'
ModuleNotFoundError: No module named 'django-private-files'  Hi...: No module named 'django-private-files' How to remove the ModuleNotFoundError: No module named 'django-private-files' error? Thanks   Hi
ModuleNotFoundError: No module named 'django-private-files-0.1.2'
ModuleNotFoundError: No module named 'django-private-files-0.1.2'  Hi...: No module named 'django-private-files-0.1.2' How to remove the ModuleNotFoundError: No module named 'django-private-files-0.1.2' error? Thanks
ModuleNotFoundError: No module named 'django-private-media'
ModuleNotFoundError: No module named 'django-private-media'  Hi...: No module named 'django-private-media' How to remove the ModuleNotFoundError: No module named 'django-private-media' error? Thanks   Hi
ModuleNotFoundError: No module named 'django-private-messages'
ModuleNotFoundError: No module named 'django-private-messages'  Hi...: No module named 'django-private-messages' How to remove the ModuleNotFoundError: No module named 'django-private-messages' error? Thanks   
ModuleNotFoundError: No module named 'django-versatileimagefield-private'
ModuleNotFoundError: No module named 'django-versatileimagefield-private' ...: ModuleNotFoundError: No module named 'django-versatileimagefield-private' How to remove the ModuleNotFoundError: No module named 'django-versatileimagefield-private
ModuleNotFoundError: No module named 'private-pypi-core'
ModuleNotFoundError: No module named 'private-pypi-core'  Hi, My... named 'private-pypi-core' How to remove the ModuleNotFoundError: No module named 'private-pypi-core' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'private-pypi-github'
ModuleNotFoundError: No module named 'private-pypi-github'  Hi, My... named 'private-pypi-github' How to remove the ModuleNotFoundError: No module named 'private-pypi-github' error? Thanks   Hi
ModuleNotFoundError: No module named 'pybbm-private-messages'
ModuleNotFoundError: No module named 'pybbm-private-messages'  Hi...: No module named 'pybbm-private-messages' How to remove the ModuleNotFoundError: No module named 'pybbm-private-messages' error? Thanks   Hi
ModuleNotFoundError: No module named 'steven-private-package-for-python'
ModuleNotFoundError: No module named 'steven-private-package-for-python' ...: ModuleNotFoundError: No module named 'steven-private-package-for-python' How to remove the ModuleNotFoundError: No module named 'steven-private-package-for-python'
ModuleNotFoundError: No module named 'django-private-chat'
ModuleNotFoundError: No module named 'django-private-chat'  Hi, My... named 'django-private-chat' How to remove the ModuleNotFoundError: No module named 'django-private-chat' error? Thanks   Hi
ModuleNotFoundError: No module named 'django-private-files'
ModuleNotFoundError: No module named 'django-private-files'  Hi...: No module named 'django-private-files' How to remove the ModuleNotFoundError: No module named 'django-private-files' error? Thanks   Hi
ModuleNotFoundError: No module named 'django-private-files-0.1.2'
ModuleNotFoundError: No module named 'django-private-files-0.1.2'  Hi...: No module named 'django-private-files-0.1.2' How to remove the ModuleNotFoundError: No module named 'django-private-files-0.1.2' error? Thanks
ModuleNotFoundError: No module named 'django-private-media'
ModuleNotFoundError: No module named 'django-private-media'  Hi...: No module named 'django-private-media' How to remove the ModuleNotFoundError: No module named 'django-private-media' error? Thanks   Hi
ModuleNotFoundError: No module named 'django-private-messages'
ModuleNotFoundError: No module named 'django-private-messages'  Hi...: No module named 'django-private-messages' How to remove the ModuleNotFoundError: No module named 'django-private-messages' error? Thanks   

Ads