Site Tools


Smart Card Solution

User Manual

JavaCard API Samples

Java Card Specification

Knowledge Sharing


6.1.6 Static Fields and Methods

Instances of classes (objects) are owned by contexts. Classes themselves are not. There is no runtime context check that can be performed when a class static field is accessed. Neither is there a context switch when a static method is invoked. Similarly, invokespecial causes no context switch.

Public static fields and public static methods are accessible from any context: Static methods execute in the same context as their caller.

Objects referenced in static fields are just regular objects. They are owned by whomever created them and standard firewall access rules apply. If it is necessary to share them across multiple contexts, these objects need to be Shareable Interface Objects (SIOs), see Section 6.2.4, Shareable Interfaces.

Of course, the conventional Java technology protections are still enforced for static fields and methods. In addition, when applets are installed, the Installer verifies that each attempt to link to an external static field or method is permitted. Installation and specifics about linkage are beyond the scope of this specification.

javacard/jcre/6.1.6_static_fields_and_methods.txt · Last modified: 2017/05/13 04:07 (external edit)