首页 > 解决方案 > 将 java 函数/方法转换为 json 对象

问题描述

我正在构建一个 java 方法的代码摘要算法,我正在尝试在 json 文件中构建一个数据集以进行训练,如下所示

爪哇代码

public void sum(int a,int b){
/*printing the sum of two number*/
System.out.println(a+b);
}

JSON文件

{"code":"public void sum(int a,int b){System.out.println(a+b);}","comment":"printing the sum of two number"}

标签: javajson

解决方案


推荐阅读