Access Modifiers – Public, Private, Protected & Default


Public This is the least restrictive,accessible to entire project;

Default If no access modifier is specified in the declaration, accessible only within package,not accessible in other packages or sub packages;

Protected Accessible to all classes in the package and to all sub-classes of its class in any package where this class is visible.

Private -This is the most restrictive accessibility modifiers. These members are accessible only with in the same class.



Related Posts:

  • MAVEN  Prepare Eclipse   project folder -->mvn eclipse:eclipse Normal Clean   project folder -->mvn clean; Normal Build  project folder -->mvn install; Normal Clean and Buil… Read More
  • Spring load .property file and get test.property [src/main/resource] ------------ #main kk=directory/kk main.wide=this/wide ----------spring import java.io.InputStream; import java.util.Properties; import org.springframework.context.annotation.Scope; impor… Read More
  • Fail maven.plugin Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-war) on project  in pom.xml-->build -->plugins-->add plugin <build> <finalName>${project.artifactId}</final… Read More
  • SQL TABLE -MAPPING- FOREIGN KEY RELATION CREATION & DROP //Table-----------------Application--------- DROP TABLE IF EXISTS `myschema`.`application`; CREATE TABLE  `myschema`.`application` (  `APPLICATION_ID` int(11) unsigned NOT NULL AUTO_INCREM… Read More
  • HQL One to many join query Enity Relation class Player { List<Item> inventory; } class Item { List<Enchantment> enchantments; } class Enchantment { boolean isSuperiorEnchantment; } Select Query sele… Read More

0 comments:

Post a Comment