
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What are the unary operators in Java?
These are the operators which act on only one operand. There are three kinds of unary operators Assume integer variable A holds 10 –
Operator | Description | Example |
---|---|---|
- (Unary Minus) | This operator is used to negate a given value. | -10 |
++(Increment Operator) | This operator is used to increment the value of a variable by 1. | ++10 gives 11 |
--(DecrementOperator) | This operator is used to decrement the value of a variable by 1. | --11 gives 10 |
- Related Questions & Answers
- What are unary operators in C#?
- Unary operators in C++
- Overloading unary operators + in C++
- Unary operators in C/C++
- What are the arithmetic operators in Java?
- What are the logical operators in Java?
- What are the bitwise operators in Java?
- What are the relational operators in Java?
- What are the assignment operators in Java?
- What are the ternary operators in Java?
- What are the logical operators in C#?
- What are JavaScript Operators
- What are the restrictions on increment and decrement operators in java?
- What are operators in JavaScript?
- Java Unary Operator Examples
Advertisements