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 - Java Tutorial
From the course: Java 11+ Essential Training
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
-
-
-
-
-
Work with primitive variables5m 43s
-
Declare and modify primitive values3m 27s
-
Declare and initialize object variables3m 40s
-
Manage currency values with BigDecimal3m 8s
-
Convert values between numeric types2m 40s
-
Math operators and the Math class2m 22s
-
Manage true and false Boolean values2m 43s
-
Manage character values as primitives3m 13s
-
More about Java operators5m 45s
-
-
-
-
-
-
-
-