From the course: Learning JVM Languages: JVM, Java, Scala

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Writing Java code

Writing Java code

- [Instructor] Hi, welcome to a brand new video, Writing Java Code. Previously, we looked at OOP concepts and Java. In this video, we're going to look at operators, conditional statements, arrays, and collections, starting with operators. Some of the most important operators of the Java language are summed up in this table. Note that Java knows more operators than the ones listed here. Operators that are very common in all other programming languages are not listed here. We'll now look at some examples of the uses of these operators. We'll create a new project and name it as OperatorDemo. In the main class, we'll add this code. Save this file. When run, this will print this output to the console. Since the i integer variable is declared inside a method, it must be explicitly initialized. In this case, it starts with the value zero. The second line in the method prints the current value, which is zero, then increases it silently to value one. The next line increases the i variable with…

Contents