笔试题答案

如果你不相信努力和时光,那么成果就会是第一个选择辜负你的。不要去否定你自己的过去,也不要用你的过去牵扯你现在的努力和对未来的展望。不是因为拥有希望你才去努力,而是去努力了,你才有可能看到希望的光芒。笔试题答案,希望对大家有帮助,欢迎收藏,转发!站点地址:www.bmabk.com,来源:原文

  1. Please describe what is the polymorphism? Please Explain how to use inheritance, interfaces, and abstract classes to achieve polymorphism. What is different between key word interface and @interface.
In Java, polymorphism has two implementations:
2. Static polymorphism implemented by method overloading
3. Runtime polymorphism of method override implementations (because of inheritance, subclasses can call methods of their parent classes. To achieve runtime polymorphism)
Polymorphism means that the same code can achieve different function.
And,
interface declares the interface
@interface declares annotations
  1. Please explain what serialization is and how to serialize objects in Java.
1. Serialization represents the process of converting a Java object into a byte stream.
2. The Serializable interface is implemented for the class that needs to be serialized, and an output stream is used to construct an ObjectOutputStream object
  1. Please explain how to use Spring Boot to develop RESTful API, including which annotations can help you quickly create API.
SpringBoot uses some annotations to implement Restful apis, if we wanna create a restful API, we need those steps,

A. Confirm request type and resource url, we can use those annotations to replace @RequestMapping(…)
1. @GetMapping processes Get requests
2. @PostMapping Handle Post requests by 
3. @PutMapping is used to update resources
4. @DeleteMapping processes the deletion request
5. @PatchMapping is used to update some resources

B. Confirm the received request body, we can use those anotations
1. @PathVariable gor data from url
2. @RequestBody get data from request body

C. use postman doing testing
  1. Now the operator has held a contest and received some entries, and the form of the data record form is as follows, and now the operation wants to count how many participants are for each gender, please take out the corresponding results
    example:user_submit
    device_id profile blog_url
    2138 180cm,75kg,27,male http:/url/bigboy777
    3214 165cm,45kg,26,female http:/url/kittycc
    6543 178cm,65kg,25,male http:/url/tiger
    4321 171cm,55kg,23,female http:/url/uhksd
    2131 168cm,45kg,22,female http:/urlsydney
    Please refer the example to prepare your sql and get below result:
    gender number
    male 2
    female 3
select gender,count(*) from 
(select device_id, substr(profile, 15) gender from user_submit) tmp
group by tmp.gender;

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/202476.html

(0)
飞熊的头像飞熊bm

相关推荐

发表回复

登录后才能评论
极客之音——专业性很强的中文编程技术网站,欢迎收藏到浏览器,订阅我们!