Page 1 of 1

java card applet development :transmit a value directly or use a final variable

Posted: Fri Sep 11, 2015 5:39 am
by GraceGIRL
I am new to java card applet development.
Now I am confused with the issue about the ways to transmit value.
See the last parameter pls.
1. Transmit a value directly

Code: Select all

Util.arrayCopyNonAtomic(DataBuffer,p1p2,buffer,(short)0,(short)8);

2. Transmit value by a final variable

Code: Select all

final static short copy_length=8;
Util.arrayCopyNonAtomic(DataBuffer,p1p2,buffer,(short)0,copy_length);

Which expression is better for applet development ?

Re: java card applet development :transmit a value directly or use a final variable

Posted: Thu Oct 08, 2015 6:07 am
by Larson
The second method is better than the first one. Moreover, if you want to change the value, you only need to change the value in definition command.