Java is a programming language mainly used in the back-end for server-side programming (where all the logic or processing of the user requests is handled). Instead of Java, fCC teaches NodeJS and ExpressJS for the back-end coding.
There are different back-end programming languages - Java, C#, Python, PHP, Ruby and so on. Each one is supported by its own frameworks. These frameworks come with built in features which eases a Web Developer with many tasks like connecting to the database, authentication and so on.
For example, there are Django and Flask frameworks for Python, .NET Framework/ASP.NET for C#, SpringBoot for Java and so on. Django for example comes with its own features like caching, authentication, ORM and so on. Similarly, for those who like Microsoft, .NET also has its own Entity Framework for object to relational mapping (ORM) which maps classes and objects to relations/tables in the database and treats each column/attribute of the table as a property of that class/object. So when you populate an object with values from the user or programmatically, the table automatically gets updated in the background once that object is updated. The mapping takes care of it. Some of these also come with their own controls(buttons, text boxes,etc.) which you can drag and drop and generate some code in the background which you just have to manipulate. Then comes the question of databases to store your data - which language and framework goes with which one! Python is widely used with MongoDB, C# and ASP.NET with SQL Server traditionally and now with Azure SQL Server, PHP with MySQL, Java mostly with Oracle and sometimes with MySQL and so on, although these connect to other databases as well.
So it depends on which web development stack you wanna be with and which language you prefer. And besides efficiency, which one has a large community to support you in case you are stuck with something.
These days Java is used more with their Spring/SpringBoot framework with which an entire web app can be up and running in just a few days. I personally never preferred Java so didn’t work with it, except for a few cases where it was a need. But many companies like JPMorgan Chase, Amazon, AllState, etc. do use it.
If you want to educate yourself more on Java and its packages, check out these links:
Top 5 Java Web Application Technologies You Should Master in 2022 | upGrad blog
Top 10 Most Popular Java Frameworks for Web Development - GeeksforGeeks
What is Java Spring Boot? | IBM
Also check out the different web development tech stacks:
A Guide to Modern Web Development Stacks | Enkonix | Enkonix