0% found this document useful (0 votes)
3 views2 pages

Java Operators Btech Notes

The document provides an overview of operators in Java, which are symbols used to perform operations on variables and values. It categorizes operators into types such as arithmetic, relational, logical, assignment, unary, bitwise, and ternary, each serving specific functions in programming. The conclusion emphasizes the importance of operators in enabling efficient data manipulation and enhancing code functionality.

Uploaded by

nischaysingh420
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Java Operators Btech Notes

The document provides an overview of operators in Java, which are symbols used to perform operations on variables and values. It categorizes operators into types such as arithmetic, relational, logical, assignment, unary, bitwise, and ternary, each serving specific functions in programming. The conclusion emphasizes the importance of operators in enabling efficient data manipulation and enhancing code functionality.

Uploaded by

nischaysingh420
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Operators in Java – B.

Tech Exam Notes

Introduction
In Java, operators are special symbols used to perform operations on variables and values.
Operators allow programmers to manipulate data and perform calculations, comparisons, and
logical operations in programs.

Types of Operators in Java


Operator Type Examples Description
Arithmetic +, -, *, /, % Perform mathematical calculations
Relational ==, !=, >, <, >=, <= Compare two values
Logical &&, ||, ! Combine or invert boolean conditions
Assignment =, +=, -=, *=, /= Assign values to variables
Unary ++, --, ! Operate on a single operand
Bitwise &, |, ^, ~ Perform bit-level operations
Ternary ?: Conditional operator returning one of two values

1. Arithmetic Operators
• Used to perform mathematical operations.

• Example: int sum = a + b;

2. Relational Operators
• Used to compare two values.

• They return a boolean result (true or false).

3. Logical Operators
• Used to combine multiple conditions.

• Commonly used in decision-making statements like if and loops.

4. Assignment Operators
• Used to assign values to variables.

• Example: x += 5 means x = x + 5.

Advantages of Operators
• Allow efficient data manipulation.

• Reduce code complexity.

• Enable mathematical and logical computations.


Conclusion
Operators are essential elements of Java programming. They allow developers to perform various
operations on data, making programs functional and efficient.

You might also like