我有以下方法,
public Response process(Applicant appl)
{
String responseString;
String requestString;
requestString = createRequestString(appl);
responseString = sendRequest(requestString);
Response response = parseResponse(responseString);
return response;
}
Run Code Online (Sandbox Code Playgroud)
在这里,我想返回responseString和response,一个是String类型,另一个是Response类的对象.我怎样才能做到这一点?
我有2个字符串变量autoCollateral
和secureCollateral
.我需要将值设置为collateral
具有非null值的变量的值.
我把代码编写为
if(autoCollateral!=null){
collateral=autoCollateral
}
if(secureCollateral!=null){
collateral=secureCollateral
}.
Run Code Online (Sandbox Code Playgroud)
如果两者都有价值,我需要设置它们中的任何一个......最优化的方法是什么?
for (int i = 0; i < reports.length; i++) {
Products[] products = reports[i].getDecisions;
for (int j = 0; j < products.length; j++) {
}
}
Run Code Online (Sandbox Code Playgroud)
在这里,我想从1开始索引内部for循环,但它没有按预期工作,我也改变了j
java ×3