Does this affect memory if I have two Java classes that have their own calls to compiled C code, and I call both of these classes in another class? For example, I have class A and class B with both calls to my own functions. They are configured as follows:
public class A{ // declare the native code function - must match ndkfoo.c static { System.loadLibrary("ndkfoo"); } private static native double mathMethod(); public A() {} public double getMath() { double dResult = 0; dResult = mathMethod(); return dResult; } } public class B{ // declare the native code function - must match ndkfoo.c static { System.loadLibrary("ndkfoo"); } private static native double nonMathMethod(); public B() {} public double getNonMath() { double dResult = 0; dResult = nonMathMethod(); return dResult; } }
Then class C calls both, since they both make a static call to load the library, what does it matter in class C? Or is it better if class C calls System.loadLibrary (...?
public class C{
Jpg
source share