java编码规范考试题答案[17页] 下载本文

内容发布更新时间 : 2024/5/23 0:35:15星期一 下面是文章的全部内容请认真阅读。

个人收集整理勿做商业用途

31.当与非信任代码(非产品包)……..ACD

32.以下哪些方式是被禁止的 ABC

33.当外部输入用于以下。。。。合法性验证。。。。ABCD

34.以下哪些场景。。。安全检查 ACD

35.下列异常中,哪些易引起信息泄露 ABCD

36.下列关于编码相关,错误的是。。。ACD

37.目录遍历攻击。。。。AC

38.对于文件IO操作。。。。。ABCD

39.安全规范中,如下。。。正确的有 ACD

40.为防止敏感数据传输。。。。ABC

三、判断题

41. 将字符串转换为数字时必须处理NumberFormatException异常

42. 一个文件不要定义两个类(并非指内部类)

43. interface 中定义的常量不要写public、static、final的修饰词,方法需要写public

修饰词

×文档来自于网络搜索 13 / 17

个人收集整理勿做商业用途

44. 应明确规定对接口方法参数的合法性检查应由方法的调用者负责还是由接口方法本身

负责,缺省是由方法调用者负责

√文档来自于网络搜索 √

45. 代码提交前,需要消除相应的错误、告警,并将findbug清零

46. 对于switch语句下的case语句,必须在每个case分支结束前加上break语句

47. 判断语句可以使用”* == true”来判断为真

×

48. 不要使用循环将集合转为数组,可以使用集合的toArray()方法

49. 实现Serializable接口的可序列化类应该显式private static final声明

serialVersionUID

√文档来自于网络搜索 ×

50. 类属性和类方法可以交叉放置

51.敏感对象发出信任。。。

×

×

52.带有敏感。。。HTTP。。。GET。。。

53.不能直接将来自不。。。一部分

14 / 17

个人收集整理勿做商业用途

54.对于JSP语言。。。访问

×

55.由于序列化将对象。。。。不需要加密

56.对外部字符串。。。。NFKC

×

57.安全编码规范中。。。。一个jar包中

58.对于java.io.FileNotFoundException。。。。

59.对外部输入进行。。。“黑名单”方式

× √

60.异常中的文本描述信息。。。信息泄露

15 / 17

个人收集整理勿做商业用途

版权申明

本文部分内容,包括文字、图片、以及设计等在网上搜集整理。版权为张俭个人所有

This article includes some parts, including text, pictures, and design. Copyright is Zhang Jian's personal ownership.文档来自于网络搜索 用户可将本文的内容或服务用于个人学习、研究或欣赏,以及其他非商业性或非盈利性用途,但同时应遵守著作权法及其他相关法律的规定,不得侵犯本网站及相关权利人的合法权利。除此以外,将本文任何内容或服务用于其他用途时,须征得本人及相关权利人的书面许可,并支付报酬。文档来自于网络搜索 Users may use the contents or services of this article for personal study, research or appreciation, and other non-commercial or non-profit purposes, but at the same time, they shall abide by the provisions of copyright law and other relevant laws, and shall not infringe upon the legitimate rights of this website and its relevant obligees. In addition, when any content or service of this article is used for other purposes, written permission and remuneration shall be obtained from the person concerned and the relevant obligee.

文档来自于网络搜索

16 / 17