Wrapping C/C++ inside Java

前端 未结 8 1464
Happy的楠姐
Happy的楠姐 2021-02-07 09:24

I develop applications/programs in C/C++. I am more versed in these two languages and love being a C++ developer. I am wondering how to create a Java program that contains all m

8条回答
  •  囚心锁ツ
    2021-02-07 09:45

    If you want to call C++ from Java, you'll need to use JNI - Java Native Interface.

    Be warned that you lose some of the benefits of the garbage collector, since it can't deal with your C++ objects, and your code won't be portable anymore.

    Maybe you'd be better served by learning to write 100% Java and leaving C++ behind, but that's just a suggestion.

提交回复
热议问题