Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners private and protected
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


santosh kumar
private and protected
1 Answer(s)      3 years ago
Posted in : Java Beginners


what is diffrence between private and protected ?


Advertisement
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     
private constructor
private constructor  can we extend from a class which is having private constuctor
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
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
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
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 Cloud Hosting
Private Cloud Hosting  Hi, What is Private Cloud Hosting? What are the benefits of Private Cloud Hosting? Thanks
Java private constructor
Java private constructor  what is private constructor?what are the uses of writing private constructor in our program
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
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
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
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
Virtual Private Servers
Virtual Private Servers A Virtual Private Server or VPS for short is also know as Virtual Dedicated Server (VDS). Virtual Private Servers is many servers... of a dedicated server to many customers as low cost. In case of Virtual Private Server
What's the proper way to test a class with private methods using JUnit?
What's the proper way to test a class with private methods using JUnit?  What's the proper way to test a class with private methods using JUnit
Access Modifier
Access Modifier       Functionality The AccessModifer Plug-in for Eclipse allows the user to change the visibility (public, protected, default, private) and other
profile doesn't match any valid certificate private key pair in the default keychain
profile doesn't match any valid certificate private key pair in the default keychain   Hi, I am not able to create my application build. Following error is coming profile doesn't match any valid certificate private key pair
Learn to Set Up An Internal Private Repository For An Organization
Learn to Set Up An Internal Private Repository For An Organization       We...;private-internal-repository</key> <description>Private
PBX
PBX       PBX refers to Private Branch eXchange, a private owned multitasking exchange system that is being popular in the small and big institutes and corporation houses because
Most Common TCP Ports
Ports are basically divided into three ranges: the Common Ports, the Registered Ports, and Private Ports. The Common Ports are those from 0 through 1023. The Registered Ports are those from 1024 through 49151 The Private Ports
About Asola Bhatti Wildlife Sanctuary Delhi
well protected. The Asola Bhatti Wildlife Sanctuary is a spot located... is often seen as the many protected space for animals and other parts of wildlife... is that it continues to be well maintained and protected to this day. In fact, the local
Java Interview Questions - Page 1
Question: Can a private method of a superclass be declared within a subclass? Answer: Sure. A private field or method or inner class belongs to its declared class and hides from its subclasses. There is no way for private stuff
Car Rentals in Delhi
Car/ Coach Rentals in Delhi Want to visit the city of Delhi in a private car so that you can stop and go at your will? You must be looking for a car rental in Delhi. There are a host of car rentals in Delhi that can offer you best
Advertisements
 

 

 

DMCA.com