Call protected method from a subclass of another instance of different packages

Don’t know the rationale, but JLS confirms this in 6.6.2. Details on protected Access (emphasis mine): A protected member or constructor of an object may be accessed from outside the package in which it is declared only by code that is responsible for the implementation of that object. So: package P2; public class P2 { … Read more

How to embed the GNU Octave in C/C++ program?

Something like this embed.cpp #include <iostream> #include <octave/octave.h> int main(int argc,char* argv) {   int embedded;   octave_main(argc,argv,embedded=0);     return embedded; } Then mkoctfile embed.cpp –link-stand-alone -o embed in order to make a standalone executable. To call octave functions whether they are provided by scripts or octaveforge modules you can then use feval which takes the octave function name as … Read more