Try This Online Java Gotchas Quiz

Published Feb 21, 2021
by Alan Richardson
cASE sTUDY

Try This Online Java Gotchas Quiz

Published Feb 21, 2021
by Alan Richardson
View Resource
View Resource

A previous blog post described the Java Gotcha "Bitwise vs Boolean Operator".

We added a variant of this, and some other Java Gotchas into a fun little Quiz called "Challenge The Sensei".

If you've read the blog post above then you'll be in a good place to ace at least one of the questions.

But your friends might not, so if you find the quiz fun, you can share it with them and see if they score as well as you.

Since we don't want to just quiz you. We want to try and use this to help educate and codify the knowledge. So we have created a Github repo that has runnable code examples for the problem, and the solution.

This is a Sensei enabled repo.

When you clone the repo and load it into IntelliJ, assuming you have the Secure Code Warrior Sensei IntelliJ Plugin installed, then it will automatically see that you have a .sensei folder, and load the Sensei recipes.

When browsing the code in the IDE you should see IntelliJ prompt you that the error exists in the code, and this should make it easier to see the gotcha in the code:

  • Hover over the highlighted code then you'll see a prompt telling you about the error
  • Use the Show Context Action key: alt+enter (Windows) option+enter (macOS) and we may have a QuickFix available that can fix the code.

Sensei recipes have been added for:

We are adding more recipes and more explanatory text to cover the rest of the code in the future... but don't let that stop you from having a look at the code and spotting the error yourself.

And remember to try the quiz and "Challenge the Sensei"

Challenge The Sensei
View Resource
View Resource

Author

Alan Richardson

Want more?

Dive into onto our latest secure coding insights on the blog.

Our extensive resource library aims to empower the human approach to secure coding upskilling.

View Blog
Want more?

Get the latest research on developer-driven security

Our extensive resource library is full of helpful resources from whitepapers to webinars to get you started with developer-driven secure coding. Explore it now.

Resource Hub

Try This Online Java Gotchas Quiz

Published Jan 22, 2024
By Alan Richardson

A previous blog post described the Java Gotcha "Bitwise vs Boolean Operator".

We added a variant of this, and some other Java Gotchas into a fun little Quiz called "Challenge The Sensei".

If you've read the blog post above then you'll be in a good place to ace at least one of the questions.

But your friends might not, so if you find the quiz fun, you can share it with them and see if they score as well as you.

Since we don't want to just quiz you. We want to try and use this to help educate and codify the knowledge. So we have created a Github repo that has runnable code examples for the problem, and the solution.

This is a Sensei enabled repo.

When you clone the repo and load it into IntelliJ, assuming you have the Secure Code Warrior Sensei IntelliJ Plugin installed, then it will automatically see that you have a .sensei folder, and load the Sensei recipes.

When browsing the code in the IDE you should see IntelliJ prompt you that the error exists in the code, and this should make it easier to see the gotcha in the code:

  • Hover over the highlighted code then you'll see a prompt telling you about the error
  • Use the Show Context Action key: alt+enter (Windows) option+enter (macOS) and we may have a QuickFix available that can fix the code.

Sensei recipes have been added for:

We are adding more recipes and more explanatory text to cover the rest of the code in the future... but don't let that stop you from having a look at the code and spotting the error yourself.

And remember to try the quiz and "Challenge the Sensei"

Challenge The Sensei

We would like your permission to send you information on our products and/or related secure coding topics. We’ll always treat your personal details with the utmost care and will never sell them to other companies for marketing purposes.

To submit the form, please enable 'Analytics' cookies. Feel free to disable them again once you're done.