In this article Operators in Java we give the information about Operators and keywords play a very important role in Java. Such as Arithmetic Operators, Relational Operators, etc.

Operators in Java:

Operators and keywords play a very important role in Java.

  1. Operators

Operators are symbols that are used to perform actions or calculations. These are used to change or compare the value of a variable.

Types of Major Operators:

  1. Arithmetic Operators: These operators are used for arithmetic calculations.
    • + :  Addition
    • – : Subtraction
    • * : Multiplication
    • / : Division
    • % : Modulus
  1. Relational Operators: These operators establish a relationship between two values.
    • == : Equal to
    • != : Not equal to
    • > : Greater than
    • < : Less than
    • >= : Greater than or equal to
    • <= : Less than or equal to
  1. Logical Operators: These operators are used for logical operations.
    • && : Logical AND
    • || : Logical OR
    • ! :Logical NOT
  1. Assignment Operators: These operators are for assigning value to the variable.
    • = : Assignment
    • += : Add and assign
    • -= : Subtract and assign
    • *= : Multiply and assign
    • /= : Divide and assign
  1. Increment and Decrement Operators: These operators are used to increase or decrease the value of the variable by 1.
    • ++ :Increment
    • — : Decrement
  1. Bitwise Operators: These operators are for performing operations at bit level.
    • & : AND
    • | : OR
    • ^ : XOR
    • ~ : NOT
    • << : Left shift
    • >> :Right shift

2.Keywords

Keywords in Java are special reserved words that are used to define a particular function or structure. We cannot use these as names of our own variables or methods.

Major keywords:

  1. Control Statements:
    • if : If condition
    • else : Else condition
    • switch : Switch case
    • case : Case
    • for : For loop
    • while : While loop
    • do : Do-while loop
    • break : Break loop
    • continue : Continue loop
  2. Class Definition :
    • class : Defines a class
    • interface : Defines an interface
    • extends : Inheritance
    • implements : Implements interface
  3. Access Modifiers :
    • public : Accessible to all
    • private : Accessible within the class
    • protected : Accessible within package and subclasses
    • final : Cannot be changed
  4. Object Oriented Keywords:
    • new : Creates a new object
    • this : Refers to current object
    • super : Refers to superclass
    • static : Static method or variable
    • abstract : Abstract class or method
  5. Exception Handling :
    • try : Try block
    • catch :Catch block
    • finally : Finally block
    • throw : Throw exception
    • throws : Declare exception
  6. Miscellaneous :
    • void : No return type
    • return : Returns a value
    • import : Imports a package
    • package : Defines a package
    • null :Null value
    • true : True boolean value
    • false : False boolean value

These were some of the major operators and keywords of Java, which are used in any Java programming language.

Some More: 

POP- Introduction to Programming Using ‘C’

DS – Data structure Using C

OOP – Object Oriented Programming 

Java Programming

DBMS – Database Management System

RDBMS – Relational Database Management System

Join Now: Data Warehousing and Data Mining 

Leave a Reply

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