keelin terry

03 May 2018

4 Comments

Home Quiz

Java Quiz for Beginners

Java Quiz for Beginners

This fun quiz will test your knowledge on the foundations and principles of Java. It will also help you practice for the Oracle Java Foundations Certificate.

Which of the following file extension types store the source code?

Thank you for taking our quiz. If you are interested in developing your java skills further. Here at iSkill we like to take a practical approach in our training. This means our programming courses are extremely hands on. We’ve found that this approach works wonders for learning the craft of coding, as just knowing the theory of writing code will not have you ready for the real world. So expect to be writing a lot of code and making plenty of personal projects in no time!

Java Programming Course

4 Comments

    • keelin terry says:

      Hi Muhammad,
      Thanks for you comment. This quiz is designed to test your knowledge on the foundations and principles of Java. Why not try it out?
      Also keep an eye out for our upcoming online Java Course which will be coming soon. Thank You!

  • Spencer says:

    Hello,

    Good quiz for the individuals starting out with Java. However, I wanted to point out a couple of potential mistakes that I noticed:

    1) “Which of the following declarations correctly declares an int with the value of 10?” The answer to this question in the quiz is “int i = 5 + 5”; however, “int i = 10;” should be an accepted answer.

    Both of those lines of code declare a variable that’s an integer with the value of 10. One of them gives the direct value of 10, while the other one does addition.

    2) “Which of the following lines of code will cause an error when compiling?” The answer to the question in the quiz is Line3; however, I believe the answer should be Line2.

    Line3 is identical to Line1 where the variable is defined as a String, and is given the value of John or Bert. In Line2, there is no datatype being defined; this would cause an error if you attempt to run that line of code in Java. In fact, it would cause two errors.

    Just thought I’d point that out. If I’m mistaken please let me know.

    • Dean Harrison says:

      Hi Spencer,

      Glad to see you enjoyed the quiz. Just to address the mistakes you found I think we caught you a bit on the questions.

      1) You are correct in what you say “int i = 10;” would be an accepted answer as it does indeed initialize an int variable with the value of 10. However the answer is actually “Int i = 10;” which would be a compiler error due to the keyword int being lower-case.

      2) You are correct, Line 1 and Line 3 are identical. However, the fact they are identical is the reason Line 3 is a compiler error. You can not declare a variable with the same name twice within the same scope. Line 2 is fine as it does not need a datatype defined due to the fact it is already declared on Line 1.

      Hope this helps you on your Java journey!

      Cheers,
      Dean

Leave a Reply

Your email address will not be published. Required fields are marked *

Categories

Find Us:

Contact US