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



Home Answers Viewqa Java-Beginners private and protected

Have Programming Question? Ask it here!
 
 
 


santosh kumar
private and protected
1 Answer(s)      2 years and 8 months 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     
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
private constructor
private constructor  can we extend from a class which is having private constuctor
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 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
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
Cheap Web Hosting Services in India
Cheap Web Hosting Services in India Roseindia Technologies Private Limited (RTPL) provides the best web hosting services on Windows, Linux and Dedicated web servers at cheaper price in the India. We know the needs of the customers
Cheap Web Hosting Services in Mumbai
Cheap Web Hosting Services in Mumbai Roseindia Technologies Private Limited (RTPL), a progressive IT firm despite rooting in Delhi provides best facilitation of cheaper web hosting services in Mumbai, the economic capital
PHP Mutator Accessor
of the class are declared as private to protect and can be modified by a public declared... of the private data member. These methods can be implemented on non-object-oriented...) of the variable. PHP Mutator Method Example: <?php class One{ private
Encapsulation in Java
is the technique of binding or wrapping the data and the codes in a class private... hiding where a code and data declared private cannot be accessed by any other code... Enum; public class StudentDetails { private String name; private String
SSL Certificates
SSL Certificates Secure Sockets Layer or SSL for short is a protocol. It was developed by Netscape for transmitting private documents over internet. SSL... using its private key and uses the symmetric key to decrypt the URL and http
GPS Vehicle Management
GPS (Global Positioning System) is the technology, which is largely in use for vehicle tracking, that ultimately helps in managing a vehicle. The GPS Vehicle management is necessary whether it is a private business or a government one
Cheap Web Hosting Services in Asia
Cheap Web Hosting Services in Asia Roseindia Technologies Private Limited (RTPL), a well-known software development firm, famous for a wide range of services is now providing low cast web hosting services without compromising
Benefits of Fleet Management
With the advancement in the field of fleet businesses, fleet management has become crucial for the survival of a private company. It not only helps companies to have a control over their vehicles but also payoff with profits. Fleet
Cheap Web Hosting Services in Delhi
Cheap Web Hosting Services in Delhi Roseindia Technologies Private Limited (RTPL) is a Delhi based software development firm that provides the best web hosting services on Windows, Linux and Dedicated web servers at cheaper
Intranet Application Development, Intranet Application Development Solutions, Intranet Design
Intranet Application Development Intranet Application Development Services India An intranet is a network of private computers linked... and private websites are an important component and focal point of internal
java
java  Can we define private and protected modifiers for variables in interfaces?  no  No , We can not define private and protected modifiers for variable in interface
PMD For Eclipse
code - unused local variables, parameters and private methods Suboptimal
What is Fleet Management?
A success is guaranteed in a fleet business if one truly understands what is fleet management? Every private business when in fleet business knows how crucial it is to have information of every second, how a small fault can matter a lot
The Right Reasons for Change
the norm than exception in the private sector. Most people change jobs for better
VoIP PBX Open Source
(Internet protocol private branch exchange) it maintains. The GPL-licensed
Different Kinds of Website
server, accessible via the Internet or a private local area network
What are the Cloud Computing Deployment Models?
Cloud environments. Private Cloud A Cloud computing environment designated and dedicated to a single organization is called Private Cloud. Private... on security point of view as in a public cloud environment. Typically Private Cloud
Spring Login Example
. We have created Logger.java and declared two private variables username... roseindia.model; public class Logger { private String userName; private String
Access level
Access level  Which access level allows exclusive access to the attributes and methods that belong to a class or classes derived from that class? default protected public private
Advertisements
 

 

 

DMCA.com