1(v)
Which of the following is a valid java keyword?
- (a)If
- (b)BOOLEAN
- (c)static
- (d)Switch
Show SolutionHide Solution↓
static
Reason — In Java, keywords are reserved words that have a specific meaning and purpose in the language. Keywords must always be written in lowercase. Analysing the given options:
If: Incorrect because Java keywords are case-sensitive, and the correct keyword isif(in lowercase).BOOLEAN: Incorrect because the keyword in Java isboolean(in lowercase).static: Correct.staticis a valid Java keyword used to declare static methods, variables, or blocks.Switch: Incorrect because the correct keyword isswitch(in lowercase).