Ajude a Asast
Patrocinadores
Últimos assuntos
» Novo site para desportistas / New site for athletes
Sex Mar 17, 2017 8:31 am por Admin

» List files by date
Sex Mar 17, 2017 8:24 am por Admin

» RegExp - Add XXX to the begin of a String
Sex Nov 18, 2016 1:44 am por Admin

» RegExp - Add XXX to the end of a String
Sex Nov 18, 2016 1:38 am por Admin

» Great book about DOD programming
Sex Nov 11, 2016 6:59 am por Admin

» MESOS (Apache)
Qui Set 29, 2016 1:51 am por Admin

» Site de aluguer entre particulares
Sex Jul 01, 2016 3:01 am por Admin

» Noite das maravilhas - Nuit des merveilles
Sex Jul 01, 2016 2:54 am por Admin

» Site para procura de emprego no Luxemburgo
Qui Jun 30, 2016 7:13 am por Admin

AdSense
Contributo

Java Access Modifiers

Ver o tópico anterior Ver o tópico seguinte Ir em baixo

Java Access Modifiers

Mensagem  Admin em Ter Maio 06, 2008 3:45 am

- public
- private
- protected

Public - the most generous access modifier. A public class or method may be used in any Java program without
restrictions.
Private - The least generous access modifier is private. A private variable or method may be used only by an
instance of the class that declares the variable or method.
Default - A class's default features are accessible to any class in the same package as the class in question. A
default method may be overriden by any subclass that is in the same package as the superclass. Default is not
a java keyword. it is simply a name that is given to the access level that results from not specifying
an access modifier.
Protected - Only methods and variables may be declared protected. A protected feature of a class is available
to all classes in the same package, just like a default feature. Moreover, a protected feature of a class
can be available in certain limited ways to all subclasses of the class that owns the protected feature. This
access is provided even to subclasses that reside in a different package from the class that owns the
protected feature.

Legal overidden method access:

private -> default -> protected -> public
avatar
Admin
Admin

Mensagens : 596
Data de inscrição : 21/01/2008
Idade : 39

Ver perfil do usuário http://forum-informatico.forumeiros.com

Voltar ao Topo Ir em baixo

Ver o tópico anterior Ver o tópico seguinte Voltar ao Topo

- Tópicos similares

 
Permissão deste fórum:
Você não pode responder aos tópicos neste fórum