If you want to develop Java programs yourself, you install the JDK. The JDK, on the other hand, packages the JRE along with all the necessary libraries for developing Java programs. If you would like to understand the architecture of JVM at a deeper level, I would suggest Siben Nayak’s in-depth article on the topic. If you didn’t understand every aspect of this section word by word, don’t worry. As you can see, a new class called NotMain has been added.

You can use Java to build servers, create desktop applications, games, mobile applications and more. There are also other JVM (we’ll discuss what that means very soon) languages such as Kotlin, Groovy, Scala, and Clojure that you can use for different purposes. I have referenced this book as well as the JVM specifications to write this article.

JVM Structure

This collection type is comparable to dictionaries in Python and objects in JavaScript. To make a duplicate of an array list, you can use the clone() method. Then the lambda expression will check whether the given number is divisible by 2 or not and return Java 7 SE Lessons true or false based on that. There is no length property like in an array but you can use the size() method on any array list to find out its length. The first parameter to the set() method is the index and the second one is the updated value.

Java 7 SE Lessons

You can see that the method corresponding to the 23rd has been converted to the method that returns „Lcom/nhn/user/User;“. By compiling the application code above with the updated library and then disassembling it, the following result will be obtained. The updated library source code and the original source code are as follows. A virtual machine (VM) is a software implementation of a machine (i.e. a computer) that executes programs like a physical machine. Therefore, the JVM runs on all kinds of hardware to execute the Java Bytecode without changing the Java execution code.

What is a switch-case statement?

The System.out.println(); function call will print the line I am 27 years old. In case you’re wondering, using a plus sign is one of the many ways to dynamically print out variables in the middle of a sentence. As you can tell from the name of OpenJDK, it’s open-source. The JRE or Java Runtime Environment packages together an implementation of the JVM along with a set of libraries required for running Java programs. So in order to run your program on these two different platforms, you’ll have to compile them separately.

Java 7 SE Lessons

Although I’ll explain crucial programming concepts in the context of Java, I’ll not explain things like what a variable is in the context of programming in general. Besides the description mentioned here, the JVM has various features and technologies. However, as this has been discussed in many more prominent studies, I did not explain it deeply in this article.