Find Valid Java Keywords MCQ

Q1) Which is a valid keyword in Java?

a) new
b) delete
c) both
d) None of these

View Answer Answer:- a) new

In Java, we have a “new” keyword to create objects but the “delete” keyword is not there. Because the destruction of the object is the responsibility of garbage collectors, not of programmers.

Q2) Which is an invalid keyword in Java?

a) byte
b) Short
c) int
d) long

View Answer Answer:- b) Short

Java keywords doesn’t contain any uppercase letters. “Short” is the name of a class, and “short” is a data type.

Q3) Find Invalid Java keyword?

a) break
b) continue
c) return
d) exit

View Answer Answer:- d) exit

Java have exit() method, not a keyword.

Q4) Find an invalid Java keyword?

a) instanceof
b) sizeof
c) strictfp
d) None of these

View Answer Answer:- b) sizeof

Java doesn’t contain “sizeof” keyword.

Q5) Find all invalid Java keywords? (More than one options are correct).

a) throw
b) throws
c) thrown
d) through

View Answer Answer:- c) thrown and d) through are invalid Java keywords.

Q6) Which of the following are invalid Java Keywords?

a) final
b) finally
c) finalize
d) None of these

View Answer Answer:- c) finalize

finalize() is a method defined in java.lang.Object class.

Q7) Which is a valid keyword in Java MCQ?

1) extend
2) implement
3) imports
4) synchronize
5) None of these

View Answer Answer:- 5) None of these.

Observe keywords once again. The “synchronized” is a keyword, not “synchronize”. “extends” is a keyword, not “extend”. “implements” is a keyword, not “implement”. “import” is a keyword, not “imports”. “instanceof” is a keyword, not “instanceOf”. “const” is a keyword, not “constant”.

Q8) Which of the following is not a Java reserved word?

a) public
b) static
c) void
d) main

View Answer Answer:- d) main

“main” is an identifier having special functionality, but it is not a reserved word.

Q9) Find the valid Java keywords?

a) null
b) true
c) false
d) None of these

View Answer Answer:- d) None of these

The null, true, and false are reserved literals, not a keywords. They can’t be used as an identifiers.

Q10) Which of the following keyword is not a data type in Java?

a) int
b) void
c) float
d) boolean

View Answer Answer:- b) void

The void keyword is a return type, not a data type.

Q11) Which of the following is a reserved keyword in Java?

a) object
b) strictfp
c) main
d) system

View Answer Answer:- b) strictfp

The strictfp keyword is a modifier that restricts the floating-point calculations to assure portability and it was added in Java version 1.2.

Q12) In Java which of the following are unused keywords?

a) const
b) goto
c) Both (a) & (b)
d) None of these

View Answer Answer:- c) Both (a) & (b)

Java contains two unused keywords “const” and “goto”.

Q13) Find out valid Java keywords?

  1. main
  2. String
  3. static
  4. synchronize
  5. sizeof
  6. finalize
  7. strictf
  8. Void
  9. instanceOf
  10. object
  1. Public
  2. imported
  3. final
  4. package
  5. enumeration
  6. do_while
  7. true
  8. array
  9. null
  10. Class
  1. protect
  2. implement
  3. that
  4. thrown
  5. constant
  6. requires
  7. require
  8. open
  9. uses
  10. to
View Answer Answer:- Among these options, only 3 are valid Java keywords. They are:- 3.static,, and 14.package

Note:- Keyword contains only lowercase letters.

If you enjoyed this post, share it with your friends. Do you want to share more information about the topic discussed above or you find anything incorrect? Let us know in the comments. Thank you!

Leave a Comment

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