From the course: Java 11+ Essential Training

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

More about Java operators

More about Java operators - Java Tutorial

From the course: Java 11+ Essential Training

Start my 1-month free trial

More about Java operators

- [Instructor] As I've described perviously, Java is a C-style language and it shares the same operators as other such languages such as C and C ++. You can roughly categorize operators in Java under these groupings: equality operators, assignment operators, mathematical operations, logical operators, and the special ternary operator that lets you abbreviate an if-then statement. I'll start with assignment and math operators. Let's say that we have an integer value. If you declare an intValue and you set it's type explicitly but you don't assign it a value, it'll default to zero and that's the same for all primitive numeric types. On the other hand, you might explicitly assign a value and use the keyword var and let the type be inferred. And as I described perviously, this only works for variables that are local within methods and only starting with Java 10. So I've assigned this value. Now I want to do some…

Contents