How many keywords are used in Java?

Asked By: Rajni Prakash

S

Suresh Kumar

There are 48 active keywords used in the Java Programming language:

  1. abstract, assert (2 keywords start with 'a' alphabet)
  2. boolean, break, byte (3 keywords start with 'b' alphabet)
  3. case, catch, char, class, continue (5 keywords start with 'c' alphabet)
  4. default, do, double (3 keywords start with 'd' alphabet)
  5. else, enum, extends (3 keywords start with 'e' alphabet)
  6. final, finally, float, for (4 keywords start with 'f' alphabet)
  7. if, implements, import, instance of, int, interface (6 keywords start with 'i' alphabet)
  8. long (1 keyword start with 'l' alphabet)
  9. native, new (2 keywords start with 'n' alphabet)
  10. package, private, protected, public (4 keywords start with 'p' alphabet)
  11. return (1 keyword start with 'r' alphabet)
  12. short, static, strictfp, super, switch, synchronized (6 keywords start with 's' alphabet)
  13. this, throw, throws, transient, try (5 keywords start with 't' alphabet)
  14. void, volatile (2 keywords start with 'v' alphabet)
  15. while (1 keyword start with 'w' alphabet)

NO LONGER ACTIVE Java Keywords

  1. const
  2. goto

2 votes

S

Suresh Mehata

Keywords in Java

Everyone knows about keywords which are used in Java, I'm not going to discuss that, I'm going to discuss which makes some people confusing, which are about goto, const, true, false, null.

goto & const

In early days of Java goto & const were used as keywords in Java, but further goto excluded from Java programming because goto allows user to jump from one section of the program to another section of the program which may generate hold and wait for resource problem, which is very bad programming experience, for this reason, goto was got exclude from the Java keyword library.

About const, it decided that this keyword will be used kept reserved for the future use so const keyword also got excluded from the Java keyword list.

true, false, null

true, false, and null are not keyword, they are literals, they are also reserved words and they can not be used as identifiers. 

I think this information will make you more knowledgeable about Java keywords.

2 votes

N

N Srikanth

51

0 votes

A

Akshay Sune

More than 54 keyword are used in java

0 votes

Your Answer

Email Us: advertise@gdatamart.com

Legal Policy

International

© 2022 GDATAMART.COM (All Rights Reserved)