Site Tools

Sidebar

Smart Card Solution

User Manual

JavaCard API Samples

Java Card Specification

Knowledge Sharing

javacard:jcvm:4.3.7.5_instance_fields

4.3.7.5 Instance Fields

All instance fields defined in a package are assigned either public or private instance field tokens. The scope of a set of instance field tokens is limited to the class that declares the instance fields, not including the fields declared by superclasses of that class.

Instance field token values must be in the range from 0 to 255, inclusive. Public and private tokens for instance fields are assigned from the same namespace. The tokens for all the instance fields in a class are numbered consecutively starting at zero, except that the token after an int field is skipped and the token for the following field is numbered two greater than the token of the int field.

Within a class, tokens for externally visible fields must be numbered less than the tokens for package and private fields. For public tokens, the tokens for reference type fields must be numbered greater than the tokens for primitive type fields. For private tokens, the tokens for reference type fields must be numbered less than the tokens for primitive type fields. Beyond that, the ordering of instance field tokens in a class is not specified.

Visibility

Category

Type

Token Value

public and protected fields (public tokens)

primitive

boolean

0

byte

1

short

2

reference

byte[]

3

Applet

4

package and private fields (private tokens)

reference

short[]

5

Object

6

primitive

int

7

short

9

javacard/jcvm/4.3.7.5_instance_fields.txt · Last modified: 2017/05/13 04:11 (external edit)