英文:
I want to return back a Arraylist of string which contains userName in the response with the response code 200
问题
我想要返回一个字符串的ArrayList,其中包含响应中的userName,并且响应代码为200。如何实现这个?提前谢谢。
英文:
I want to return back a Arraylist of string which contains userName in the response with the response code 200. How to implement this.Thanks in advance.
答案1
得分: 1
ResponseEntity<List<String>> someMethod() {
List<String> userNames = getvalues();
return new ResponseEntity<>(userNames, OK);
}
英文:
ResponseEntity<List<String>> someMethod() {
List<String> userNames = getvalues();
return new ResponseEntity<>(userNames, OK);
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论