You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A a = JSON.parseObject(json, A.class, Feature.SupportNonPublicField);
System.out.println(String.format("a1:%d,a2:%d,a3:%d",a.a1,a.A2,a.a3));
}
static class A{
@JSONField(name="A1")
int a1;
int A2;
@JSONField(name="A3")
public int a3;
}
`
输出:
a1:0,a2:2,a3:3
The text was updated successfully, but these errors were encountered:
测试代码:
` @test
public void testPrivate() {
String json = "{"A1":1,"A2":2,"A3":3}";
`
输出:
a1:0,a2:2,a3:3
The text was updated successfully, but these errors were encountered: