Browse Source

增加整数加法的示例

master
richie 5 years ago
parent
commit
f010b12533
  1. 3
      java/src/HelloWorld.java
  2. 9
      java/src/MyMath.java

3
java/src/HelloWorld.java

@ -9,5 +9,8 @@ class HelloWorld {
public static void main(String[] args) { public static void main(String[] args) {
String output = HelloWorld.hello("fanruan"); String output = HelloWorld.hello("fanruan");
System.out.println(output); System.out.println(output);
int r = MyMath.add(50, 32);
System.out.println(r);
} }
} }

9
java/src/MyMath.java

@ -0,0 +1,9 @@
/**
* @author richie
* @version 10.0
* Created by richie on 2019-08-01
*/
public class MyMath {
public static native int add(int a, int b);
}
Loading…
Cancel
Save