If you are looking to learn Java, you may be wondering where to start. Which technologies should you focus on? Whether you are new to the language, a middle-level learner, or already using Java at work, this article explores the essentials that you need to know.
Learning a programming language is a technological process that requires serious preparation. Otherwise, you can easily “choke” on the learning process itself.
I work for a company that created an interactive Java online course. From time to time, our graduates tell us about what they are required to know in interviews, and also about what technologies they use in their work. Based on these surveys, a shortlist of such technologies can be compiled.
First things first. No surprises, Core Java is a must for every Java Developer in every year of the language existence. That’s good news because even IT people need stability.
Well, Core Java is like the main rules of any language. To become a programmer you definitely need to learn to code in a general sense. Core Java contains the syntax, basic constructions and concepts of the language. Here they are.
Syntax
You may get Syntax as the Java alphabet. To learn it’s something like writing your first words in school. So the first thing you learn about Java is Syntax. However, it’s better to learn through practice from your very first learning steps.
Main Java Syntax topics:
Knowing Java syntax well is the same as knowing a foreign language at the A1 level.
OOP concepts
Modern versions of the language have supported functional programming, however, Java programming is more or less all about Object Oriented Programming (OOP).
That’s why a deep understanding of OOP is extremely important for everyone who wants to be a Java developer. This topic is not extremely tough. However, it takes a lot of practice to get a feel for all the nuances of OOP.
When studying OOP, you first need to understand what an object is, how attributes differ from behavior, and how they should be expressed in Java. The ideas of inheritance, encapsulation and polymorphism need to be understood so deeply that you can learn how to correctly build the hierarchy of objects in your programs.
While studying OOP, I recommend solving a lot of problems and reading a lot. Take a look at the code of Java classes, learn how they relate to each other. Don’t be lazy, read books that get to the point. For example, Effective Java by Joshua Bloch. This is a gem of a book and is devoted to the basic principles of the language from one of its authors, Joshua Bloch.
Collection Framework
The Collection framework provides an architecture to store and manipulate groups of objects.
Working with collections lets you perform typical data operations: searching, sorting, insertion, modification, and deletion. Collection interfaces and classes are really important to know both for your job and for interviews. They are efficient in different ways for different operations as I mentioned above. There are not so many particular classes from Collection Framework to use instantly while working. The most popular are ArrayList and HashMap.
However, during an interview, you need to perfectly navigate the collections, their features. You need to realize in what cases you need to use each of them. As you study them, you will also bring up another important topic, data structures, but more on that later.
Java Object Class
Every Java Class is implicitly inherited from the Object class. Therefore, all types and classes can implement the methods that are defined in the Object class. At some point in learning a language, I presume, after OOP, it is important to get the Object class realisation and its methods. It helps a lot to understand the essence of the language.
Exceptions
An exception is an abnormal situation, but learning them is normal and not very difficult. It’s a wonderful mechanism to simplify bug catching and absolutely all Java programmers use it in their work.
Generics
Generics (generic types and methods) allow us to get away from rigidly defining the types to use. The topic, although unusual at first, is not very complicated. The faster you learn them, the better your code will be.
Multithreading
This topic is kinda difficult for almost every Java beginner. However, our graduates point out that recruiters do not have very high requirements on this topic for those who are applying for the position of Java Junior. It all depends on the project, but novice developers rarely need to work with multithreading. And in general, this topic allows you to learn right along the way.
New Java features
Well, nobody expects that a Java beginner should know the features of the newest Java versions such as Sealed Classes, Text blocks, Records, or Hidden Classes. However, I highly recommend trying to learn some of them or at least read about them since you learned most of the Core Java topics listed above. Recently, the JDK has been updated semi-annually, in March and September. JDK 16 appeared on March 16.
So, go to the OpenJDK website, which lists all the JDK Enhancement Proposal (JEP’s) from new versions. Read on, experiment with settings, it’s really useful! Even if you are a complete beginner, start to read about them to be in on trends.
I also recommend subscribing to Java news blogs. It can be much easier for beginners to read the breakdowns done by experienced developers than to read JEP’s dry enumeration.
However, new features are still often understood as those that appeared in Java 8. They have become so unusual and changing in a sense the style of Java programming that some developers still prefer not to use them. This is not entirely correct. Java beginners and professionals in 2021 are expected to know:
Unit testing
According to CodeGym polls, Unit Testing is one of the first tasks Java Trainees get, when they are allowed to join real projects. Often, beginners are asked to test their peers’ code before allowing them to write their own module. So make a present for yourself and your future employer by learning the JUnit Framework as well as the powerful Mockito library. More experienced developers also often test their code using these libraries. So this knowledge will be useful to absolutely all Java Developers.
Data Structures and Algorithms
Data structures need to be learned, but is it worth doing at the abstraction level? In principle, it is possible, especially if you have already had time to work a little with some of their implementations in practice. In addition, very often the theoretical foundations of data structures (how and how efficiently insertion, deletion, and search are implemented in them) are demanded in interviews.
Whether it is necessary to study algorithms in detail is also a controversial topic. In this case, “algorithms” are most often understood as those that help to search, sort, delete and add data from structures. Some people think that algorithms are not needed, since all the basic, and the most efficient algorithms are already written into the language. However, while preparing for interviews, it is best to pay attention to them. In addition, they perfectly develop programmer thinking.
Java Ecosystem
When you start learning Java, often the first thing you are told about is bytecode, Java Virtual Machine, JRE, and JDK. That is how Java essentially works. However, at the first stage, this knowledge is rather a curious abstraction. I highly recommend returning to this topic at different stages of your learning, and even during work.
Understanding how the Java Ecosystem works adds a lot to your programming skill. For example, studying the work of the Garbage Collector (by the way, there are several of them, and if you follow Java updates, you will be aware of which ones are relevant) can help you realize why Java is rarely used in triple-A game projects. In general, it is very important for a developer to understand how the JVM allocates memory, what is Dynamic linking, runtime interpreter, and so on.
Design and Architectural Patterns
In 2021, trained professionals are expected to have knowledge of design patterns and the ability to apply them in practice. It is both simple and difficult at the same time. The templates themselves are simple and logical, but it can be very difficult for a novice developer to understand where and which template should be applied. So in addition to learning examples, I recommend that you consciously apply them in practice.
Something similar is true of architectural design patterns. If you are creating your own project (and it is better to create them for any beginner, at least for a portfolio), think over its architecture. It is not easy, and somewhat slows down a person at the first stage … but it is extremely useful!
Working with data
The probability that a Java programmer in 2021 will never use databases in their work is extremely small. Therefore, each software developer should get an idea about them, and best of all – consolidate it in practice.
There are two major classes of databases: SQL (relative) and NoSQL (non-relative). Relative databases are more popular so the first step is to learn them.
First, you can read about Databases and their structure. Download one of them (for example, PostgreSQL, which is free and open-source), project one or two.
For the first steps you can learn to interact with the SQL database, and learn to perform the very basic CRUD (standing for Create, Read, Update, Delete) SQL commands on the data of your first applications. There is JDBC driver, a platform-independent standard for interaction between Java applications and databases. JDBC is implemented as a java.sql package included with Java SE (standard edition). So first you can use it directly.
Later when you feel more confident, you will soon be able to further adapt the usage of Object Relational Mapping (ORM) systems: special software libraries that allow you to work with data in a more natural and human-readable format, without writing SQL queries explicitly. Undoubtedly one of the most popular and widely used Java ORMs is Hibernate. According to the 2020 CodeGym survey 63.1% of first-year Java Junior developers used Hibernate very often in their first job year.
What about noSQL? If you have time you can try MongoDB. It could be a pretty interesting experience.
The technologies I mentioned in this paragraph are quite difficult to learn on your own. They are quite complex and are best learned in a team setting, in real projects. However, it is possible.
When people talk about Enterprise technologies related to Java, they usually mean two main stacks, Spring Framework and Jakarta Enterprise Edition (formerly Java Enterprise Edition, JavaEE).
They do similar things, but not quite. You can think of Spring as a set of frameworks, while pure Jakarta is a set of specifications and standards.
Spring is ideal for developing small GUI front-end applications or microservices architecture. However, leaving the dependency on application servers negatively affected the scalability of Spring applications.
Java EE is well suited for implementing a scalable, monolithic clustered application.
In the labor market, at the moment, developers who are familiar with the Spring Framework are more in demand. Historically, in the days when Java EE was overcomplicated, Spring “gained a client base.”
So it is more logical in 2021 to make efforts to learn Spring. Nevertheless, it would be better to get acquainted (at least superficially) with both platforms. Write a small home project in both Java EE and Spring. Then delve into the framework that is required at work.
Spring Framework is a huge ecosystem for building backends. The most important parts of Spring to learn:
JakartaEE
Useful Components
Some employers expect future programmers to know a number of tools and libraries that help in their work.
Pretty impressive long list, isn’t it? However, this all has an undisputed plus: Java is changing not abruptly, but gradually, and the vast majority of the technologies and libraries listed here will remain relevant for many years after 2021. Although, the list may become somewhat longer.
Previously published at https://jaxenter.com/java-2021-174063.html