Which of the following are keywords? (A) switch (B) integer (C) default (D) boolean (E) object
-
(B) & (C)
-
(E)
-
(A) & (C)
-
(D)
Java keywords are reserved words with special meaning. 'switch' and 'default' are valid keywords. 'integer' is not a keyword (int is the primitive type). 'boolean' is a keyword (primitive type). 'object' is not a keyword (Object is a class).
To answer this question, we need to understand what keywords are in programming.
Keywords are reserved words that have a predefined meaning in a programming language. They cannot be used as variable names because they have a specific purpose within the language.
Let's go through each option to determine which ones are keywords:
Option A) (B) & (C) - This option is incorrect. While "integer" and "default" are commonly used terms in programming, they are not keywords in most programming languages.
Option B) (E) - This option is incorrect. "Object" is a common term in programming, but it is not a keyword in most programming languages.
Option C) (A) & (C) - This option is correct. "Switch" and "default" are keywords in many programming languages. They have a specific purpose and cannot be used as variable names.
Option D) (D) - This option is incorrect. "Boolean" is a common term in programming, but it is not a keyword in most programming languages.
Therefore, the correct answer is option C.