From the course: Java 8 Essential Training
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Using Java operators - Java Tutorial
From the course: Java 8 Essential Training
Using Java operators
- I've already used a number of Java's operators in my examples, but I'll take a moment now to go through them in detail. Java syntax is based on C. It's a C-style language. And so it uses most of the same operators that you'll find in most C-style languages, including C, C++, C#, JavaScript, and so on. There are various types of operators. The equality operators are used to compare values to each other, assignment operators do exactly what it says, assign values, and there are mathematical operators and logical operators. Here are some of the most common assignment and math operators. When you declare a variable in Java you always start with the data type followed by the name of the variable. But you don't have to immediately assign a value. The default value will depend on whether the variable is a primitive or an object. But if you want to assign a value, you use the single "=" character as the assignment operator. The data type and variable name go on the left, and the value on…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Working with primitive variables8m 4s
-
(Locked)
Declaring and initializing numeric primitives6m 14s
-
(Locked)
Representing currency values with BigDecimal5m 10s
-
(Locked)
Converting numeric values5m 37s
-
(Locked)
Using mathematical operators and the Math class6m 1s
-
(Locked)
Working with Boolean values and expressions4m 49s
-
(Locked)
Working with character values3m 23s
-
(Locked)
Using Java operators6m 11s
-
(Locked)
-
-
-
-
-
-
-
-
-