Announce two new product: SmartCard Reader Rockey200 and USB2.0 Extension Cable

ROCKEY 200 is a handy and portable USB Smart Card reader that can perform read/write operations on any ISO 7816-1/2/3/4 smart cards which are compatible with protocol T=0 and T=1.

USB2.0 Extension Cable With high speed USB 2.0 devices such as USB token ,USB Card Reader and so on.

Come to try it now!

Static class variables in javacard applet

JavaCard Applet Development Related Questions and Answers.
Elisadl
Posts: 10
Joined: Tue Jan 26, 2016 11:08 pm
Points: 119
Contact:

Static class variables in javacard applet

Postby Elisadl » Tue Jan 26, 2016 11:14 pm

Hi folks!
I have some doubts about static class variables in javacard applet.

Q1: Why should I never use static class variables in java card applets or to use it very carefully ?
Q2: Why does the Static variables are stored in heap and what are the issues in using them?

Hope someone clarify my doubts. Thanks!

User avatar
UNKNwYSHSA
Posts: 628
Joined: Thu May 21, 2015 4:05 am
Points: 2975
Contact:

Re: Static class variables in javacard applet

Postby UNKNwYSHSA » Thu Jan 28, 2016 10:21 pm

A1:
1 The applet instance which create one static object can't be deleted (You should set the static object to null before delete the applet instance);
2 You should make sure the static object is null or not before use it.
A2:
1 The static object is allocated by the new statement, so it is located in heap. The data memory space can be located in heap or COR/COD;
2 You can use it when applet instances use one common object.
sense and simplicity

WhiteRabbit
Posts: 5
Joined: Thu May 17, 2018 11:04 am
Points: 40
Contact:

Re: Static class variables in javacard applet

Postby WhiteRabbit » Fri May 18, 2018 4:27 am

The static class variables are very useful for sharing data to across the object instance. Even to share the data among applets or packages.


Return to “Questions & Answers”

Who is online

Users browsing this forum: No registered users and 1 guest

JavaCard OS : Disclaimer