Access Modifier Assignment 1

  • May 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Access Modifier Assignment 1 as PDF for free.

More details

  • Words: 313
  • Pages: 2
PUBLIC public static final int PUBLIC The int value representing the public modifier. PRIVATE public static final int PRIVATE The int value representing the private modifier. PROTECTED public static final int PROTECTED The int value representing the protected modifier. STATIC public static final int STATIC The int value representing the static modifier.

FINAL public static final int FINAL The int value representing the final modifier. http://java.sun.com/j2se/1.4.2/docs/api/java/lang/reflect/Modifier.html#FINAL

1. Public A Java keyword used in a method or variable declaration. It signifies that the method or variable can be accessed by elements residing in other classes.

2. Private A Java keyword used in a method or variable declaration. It signifies that the method or variable can only be accessed by other elements of its class.

3. Protected A Java keyword used in a method or variable declaration. It signifies that the method or variable can only be accessed by elements residing in its class, subclasses, or classes in the same package.

4. Package A group of types. Packages are declared with the package keyword.

default A Java keyword optionally used after all case conditions in a switch statement. If all case conditions are not matched by the value of the switch variable, the default keyword will be executed.

5. Static A Java keyword used to define a variable as a class variable. Classes maintain one copy of class variables regardless of how many instances exist of that class. Static can also be used to define a method as a class method. Class methods are invoked by the class instead of a specific instance, and can only operate on class variables.

6. Final A Java keyword. You define an entity once and cannot change it or derive from it later. More specifically: a final class cannot be sub classed, a final method cannot be overridden and a final variable cannot change from its initialized value.

java.sun.com/docs/glossary.html

Related Documents

Access Modifier
October 2019 17
Modifier
December 2019 11
Misc Modifier
October 2019 17
Access 1
May 2020 6