试试这个在线 Java Gotchas 测验

之前的一篇博客文章描述了Java的陷阱 “按位运算符与布尔运算符”。
我们在一个名为 “Challenge The Sensei” 的有趣小测验中加入了这个变体以及其他一些 Java 陷阱。
如果你已经阅读了上面的博客文章,那么你将是回答至少一个问题的好地方。
但是你的朋友可能不会,所以如果你觉得测验很有趣,你可以与他们分享,看看他们的分数是否和你一样。
因为我们不想只问你。我们想尝试用它来帮助教育和编纂知识。因此,我们创建了一个 Github 存储库,其中包含问题和解决方案的可运行代码示例。
这是一个 老师 已启用 repo。
当你克隆仓库并将其加载到 IntelliJ 时,假设你有 Secure Code Warrior 老师 安装了 IntelliJ 插件,它会自动看到你有一个 .sensei 文件夹,然后加载了 Sensei 食谱。
在 IDE 中浏览代码时,你应该看到 IntelliJ 提示你代码中存在错误,这应该可以更容易地看到代码中的问题:
- 将鼠标悬停在突出显示的代码上然后你会看到一条提示你错误的提示
- 使用 “显示上下文操作” 键:alt+Enter(Windows)选项+回车键(macOS),我们可能会有可以修复代码的 QuickFix。
添加了 Sensei 食谱,用于:
我们将来会添加更多的配方和更多的解释性文本,以涵盖其余的代码... 但不要让这阻止你自己查看代码并发现错误。
记得试试测验然后”挑战老师“

Govern AI-driven development before it ships
Measure AI-assisted risk, enforce secure coding policy at commit, and accelerate secure delivery across your SDLC.
Explore more blogs
Lorem Issum diam quis eim leboutis ein selerisque lobortis sepitis beelrisque lobortis sepitis celerisque lobortis celeriskue filmentis celeriskue filmentis celeriskue diam
%252520%252520(3).avif)
Supercharged Security Awareness: How Tournaments are Inspiring Developers at Erste Group
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.

Security as culture: How Blue Prism cultivates world-class secure developers
Learn how Blue Prism, the global leader in intelligent automation for the enterprise, used Secure Code Warrior's agile learning platform to create a security-first culture with their developers, achieve their business goals, and ship secure code at speed

One Culture of Security: How Sage built their security champions program with agile secure code learning
Discover how Sage enhanced security with a flexible, relationship-focused approach, creating 200+ security champions and achieving measurable risk reduction.
Secure AI-driven development before it ships
See developer risk, enforce policy, and prevent vulnerabilities across your software development lifecycle.


