Java Keywords

 In Java, a keyword is a reserved word that has a special meaning and cannot be used as an identifier (e.g., variable name, class name, method name, etc.) in the program.

Some examples of keywords in Java are:

  • class: used to define a class
  • public: used to declare a member as accessible from outside the class
  • private: used to declare a member as accessible only within the class
  • static: used to declare a member as a class-level member
  • void: used to indicate that a method does not return any value
  • if, else: used for conditional branching in the program
  • for, while: used for loop control in the program
  • new: used to create an instance of a class
  • final: used to declare a variable as a constant.

Comments

Popular posts from this blog

Cryptography API

Java Applet Overview

Vector in Java