JavaCard Applet Development Related Questions and Answers.
-
leogen
- Posts: 13
- Joined: Wed Jan 06, 2016 2:45 am
- Points :94
-
Contact:
Post
by leogen » Tue Jan 17, 2017 5:23 am
I have separate packages in my project and I need to create instances for all classes in this packages. I create instance of class by the below code.
But I have problem with deleting my packages and applet after I call Digest.getInstance(). I need to implement clearInstacePool() method to set reference of digest to null in unistall() method of my applet. How can I create instance of class without implementing clearInstacePool()?
Code: Select all
public class Digest
{
private static Digest digest = null;
protected Digest ()
{
}
public static Digest getInstance()
{
if(digest == null)
digest = new Digest();
return digest;
}
public static void clearInstacePool()
{
digest = null;
}
}
-
mabel
- Posts: 237
- Joined: Mon May 18, 2015 3:09 am
- Points :1705
-
Contact:
Post
by mabel » Tue Jan 17, 2017 10:52 pm
Create instance usually involves the new operator, which has nothing to do with what methods are implemented.
Users browsing this forum: No registered users and 20 guests
JavaCard OS : Disclaimer
Board Disclaimer
The views and comments posted in these fora are personal and do not necessarily represent the those of the Management of JavaCard OS.
The Management of JavaCard OS does not, under any circumstances whatsoever, accept any responsibility for any advice, or recommentations, made by, or implied by, any member or guest vistor of JavaCard OS that results in any loss whatsoever in any manner to a member of JavaCard OS, or to any other person.
Furthermore, the Management of JavaCard OS is not, and cannot be, responsible for the content of any other Internet site(s) that have been linked to from JavaCard OS.