From the course: Java 11+ Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Declare and modify primitive values - Java Tutorial
From the course: Java 11+ Essential Training
Declare and modify primitive values
- [Instructor] In order to test out some simple code, I'm going to use Java's JShell environment. As I mentioned previously, you can run JShell from any command line or a terminal window, but if you're using IntelliJ IDEA, you can use the terminal window there. You can use any IntelliJ IDEA project for this exercise. The goal is simply to get to this screen, and from there, click terminal and then type JShell and press Enter or Return. And that should take you to the JShell environment. I'll double-click on this bar and that expands my terminal window to more full screen. First, I'm going to declare a number of primitive values using explicit data typing. I'll start off with type b equals one and that creates a byte value. I can see that value just by typing the name of the variable and pressing Enter or Return. That's something specific to Jshell, it doesn't work in actual Java code. Next, I'll create a short integer.…
Contents
-
-
-
-
-
(Locked)
Work with primitive variables5m 43s
-
(Locked)
Declare and modify primitive values3m 27s
-
(Locked)
Declare and initialize object variables3m 40s
-
(Locked)
Manage currency values with BigDecimal3m 8s
-
(Locked)
Convert values between numeric types2m 40s
-
(Locked)
Math operators and the Math class2m 22s
-
(Locked)
Manage true and false Boolean values2m 43s
-
Manage character values as primitives3m 13s
-
(Locked)
More about Java operators5m 45s
-
(Locked)
-
-
-
-
-
-
-