DEV Community

Cover image for A Simple Roadmap for Java Beginners in 2021
dbc2201
dbc2201

Posted on

A Simple Roadmap for Java Beginners in 2021

This post is for you if you can answer "yes" to all/most of the questions below:

  1. You are an engineering undergrad in a four-year course.
  2. Your major is computer science & engineering.
  3. You are inclined towards programming.
  4. You are thinking about a career in programming.
  5. You have heard about Java from your friends/peers and want to learn it.
  6. You have some form of introduction to the Java programming language but you want to further increase your knowledge.

It is easy to get overwhelmed these days by looking at what other people are doing in the programming field. Considering the variety of low-code/no-code options available out there to "create" software. Being a teacher for about 6-7 years, I've had my fair share of students coming up to me and asking "What should we learn?".

Photo by Edmond Dantès from Pexels

To which, I mostly answer "Well, start with a programming language, and learn it well." Little did I know in the beginning, that this statement mostly does more harm than good to a student who is confused about their career paths, or what choice do they make given the opportunities that they have currently been exposed to.

They (students) then start asking me a plethora of questions that are largely subjective and depend on the student itself. Sometimes, it is also a matter of taking initiative, and/or deciding on a choice and seeing it through, which I have observed is a lacking ingredient in the younger generation these days. The follow-up questions that I then receive are somewhat like this:

  1. Which is the "best" programming language?
  2. Is the "X" programming language better than the "Y" programming language? Why?
  3. Where should I start from?
  4. What all do I need to learn to land a job?
  5. I watched this YouTube video of this generic YouTuber person, will this suffice?
  6. Do I need to purchase an expensive course for this?

Alt Text

It is completely okay if you have had the same question in your mind for some time, I had the same questions myself when I started programming seriously.

As I have experienced, if you're willing to learn Java (since this post was originally about Java) in 2021, your journey from a "beginner" to a "not-a-beginner-anymore" stage will consist of largely 4 stages.

Before we begin exploring things, I would just like to make a disclaimer that a lot of people will tell you otherwise, they'll often come up to you and say "Oh, it's so easy, just do "this", watch this "video", enrol in this course..." which is complete bollocks. Learning a programming language is exactly like learning a new spoken language, your brain needs to remove or at least ignore your previous bias and get used to thinking in terms of the new language. For that, you need to put in a constant effort and hard work. If it were actually that easy as some people say, everyone you know would have been a rockstar developer and we would have been living in a programming utopia, free of problems, (maybe riddled with bugs, lol).

Just remember, what EVERY programming language does is tell a computer what to do!. In the end, everything gets translated for 1s and 0s for your CPU so it does not matter what language you use to "code" your next big app or website! Languages are for the efficiency and benefit of developers, not the computers.

To start I would recommend this book : Java: A Beginner's Guide by Herbert Schildt

1. Syntax and Semantics:

  • Data Types (The 8 Java Primitive Types)
  • Variables (The var keyword)
  • Type Conversion & Casting
  • Automatic Type Promotion
  • Arrays
  • Operators in Java (Arithmetic, Bitwise, Relational, Boolean Logical, Assignment, ? Operator, Operator Precedence)
  • Control Statements in Java (If, If-Else, If-Else-If, Switch (new and old))
  • Iteration Statements (While, Do-While, For, For-Each, Nested Loops) [continue, break and labels]
  • Using Command-Line Arguments in a Java Program
  • The String class
  • Varargs [Variable Length Arguments]
  • Scanner Class, BufferedReader Class

2. Object-Oriented Programming:

  • Types of Program Units in Java [4 - Class, Abstract Class, Interface, Enum + 1 Record]
  • Declaring and Using Objects in Methods
  • Reference Types and Values
  • Methods (method signature, method types)
  • Constructors
  • The this keyword
  • Overloading Methods
  • Overloading Constructors
  • Using Objects (Reference Types) as method parameters and arguments
  • Using Objects (Reference Types) as return types of methods
  • Recursion in Java (Call Stack, Tail-Recursion, Head-Recursion)
  • The static keyword (creating static members in a class)
  • The final keyword (with a class, with a method, with a member variable of a class)
  • Nested Classes and Inner Classes
  • Inheritance in Java (Super & subclasses) [Hierarchies in programs]
  • The super keyword (calling Super class' members from the subclass)
  • Types of Hierarchies in Java [Simple, Multi-level, Multiple, Hybrid]
  • Method Overriding
  • Abstract Classes and Abstract Members
  • Interfacing (defining an interface, implementing an interface, nested interfaces, members in an interface, private OR static OR default methods)
  • Packages in a Java program (CLASSPATH, importing)
  • Exception Handling (exception types, caught and uncaught exceptions, try-catch, try-finally, try-catch-finally, multiple catch blocks, nested try statements, throw and throws keyword, custom exceptions)
  • Multithreaded Programming (Java Thread Model, Main Thread, Creating a Thread, Thread class and Runnable interface, multiple threads, sleep() method, thread priorities, using lambda to create a thread, using anonymous class to create a thread)
  • Enumeration Classes in Java
  • Type Wrappers (Wrapper Classes in Java)
  • Boxing and Unboxing
  • Annotations in Java
  • Generics in Java (Bounded Types, Wildcard Types, Bounded Wildcards, generic methods, generic constructors, generics with static methods, generic classes, generic interfaces, overloading and overriding in generic methods, Type Erasure, generic arrays)
  • Lambda Expression (functional interfaces, lambda as arguments, method references)
  • Stream API (types of methods, common methods from the API)
  • String Handling (String class constructors, string length, string operations, character extraction, string comparison, searching strings, modifying strings, StringBuilder, StringBuffer)
  • Classes in the java.lang package

3. Data Structures & Algorithms:

  • Collections Framework in Java (collection interfaces - List, Set, Deque, collection classes, - ArrayList, LinkedList, HashSet, TreeSet, PriorityQueue, ArrayDeque, using iterators on collections, Iterator class, for-each loop, streams, Custom Collections Classes, Map Interfaces and Map Classes, Vector, Stack, Dictionary, Hashtable, Properties)
  • Misc - StringTokenizer, BitSet, Optional, LocalDate, LocalTime, LocalDateTime, GregorianCalendar, TimeZone, Locale, Random, Timer, Currency, NumberFormat, StringFormat.

4. Problem Solving:

When you have some decent knowledge of the topics written above, you can try your hands on some problem solving (a.k.a Competitive Programming, CP). Some recommended websites are

  1. TopCoder
  2. CodeForces
  3. CoderByte
  4. Project Euler
  5. HackerRank
  6. CodeChef
  7. Exercism
  8. CodeWars
  9. LeetCode
  10. Sphere Online Judge SPOJ
  11. CodingGame Choose whichever one you like all of them are for the same thing, to help you build up your knowledge of the language. There are some nice books as well which help you learn the basics of Competitive Programming like
  12. Guide to Competitive Programming Learning and Improving Algorithms Through Contests
  13. Java Coding Problems
  14. The The Complete Coding Interview Guide in Java

The intentional order of the sections is 1-2-3-4, although you could do section 4 as per your comfort, you can very well start section 4 after section 2 as well. PLEASE NOTE that this is not the complete list, there is still a lot more to cover, this is just to get you comfortable enough that you could try anything with Java after this. Hope this blog post will help at least some of you!

Top comments (11)

Collapse
 
aminmansuri profile image
hidden_dude • Edited

I generally start with objects first.. and teach algorithms later. (to beginners)

But now in 2021 I don't know if I should favor streams rather than classic loops (since it's more OO/functional). What stops me is that Java's stream syntax is somewhat convoluted (compared to Smalltalk or Lisp for example).

Collapse
 
dbc2201 profile image
dbc2201

What I personally feel is, the Streams API is actually not a general "replacement" for the conventional loops, it really shines while processing objects from the Collections Framework.
Conventional iteration using loops is a fundamental part of the language, and should be taught, or so I think. Streams could be introduced as a more meaningful way to iterate over the collections instead of using loops.

Collapse
 
aminmansuri profile image
hidden_dude

I agree in the context of Java itself. But not necessarily in the context of OO.
For/while loops are not "necessary" concepts in the OO style of programming. They are superfluous as Smalltalk itself demonstrates.

So the question is whether one is teaching an OO or functional style of programming or the practicalities of a new programming language. What do we teach first? What learning will be applicable to all languages?

But as I said, the Stream API is a bit clunky and I think it's very unfortunate that they used the word "stream" which is confusing when also talking about "inputstreams".

Thread Thread
 
dbc2201 profile image
dbc2201

Yes, I agree, I have also felt that the branches/loops in the language sometimes feel like the remnants of the imperative style of Java from the old days. But, having said that, sometimes for example, when you're just learning about creating methods in Java (not adhering to strict clean code standards), branches/iterative statements help out understand the general flow of the method's task.

One could start with those, and move their way in by understanding that there are OO principles like SOLID, and design principles in place which help out when you're beginning to design the idea of a "method" in your mind/notebook/whiteboard, though it takes a lot of time to practice them and even more to master them.

I personally took my students through a journey, where we were introduced to the imperative style first, got comfortable with it, then moved on to the OO side of things, got comfortable, then worked our way forward while approaching the functional style at the end. It is not always an easy task, but if we consider other things as prerequisites, the functional approach seems fairly easy at the end.

Ah yes, the nomenclature certainly could have been better, I could not agree more there myself.

Thread Thread
 
aminmansuri profile image
hidden_dude

I've had great results with objects first.
People tend to have a hard time grasping OO after learning the procedural style (I had trouble back in the day). But the opposite is not so. So I always tried to go as OO first as possible. In fact, we start by teaching with a little OO robot rather than the old "Hello World" from the 70s and 80s. So OO is just natural to them.

Collapse
 
parky_mittal profile image
Parshav

Reading this 8 years too late. But still got motivated to give it another shot.

Collapse
 
adam_robert_95 profile image
Adam Robert Stefan

Wow what a list there.

I started Java and finished with fundamentals module 😬 what I know is first part of this list only 😂😂 2 more huge parts left...😁🤞 🤞🤞

Collapse
 
nikkhiljha profile image
nikkhil-jha

That's very informative! I'm in 6th semester right now. If I start with core java from now, will it be beneficial in my placements?

Collapse
 
dbc2201 profile image
dbc2201

Of course, a lot of companies are hiring for Java these days. Fintech companies love Java! Kotlin, the new programming language for programming Android apps runs on the same compiler as Java.

Collapse
 
prabhatsai999 profile image
prabhatsai999

Can anybody recommend a vedio course for java ? pls!

Collapse
 
dbc2201 profile image
dbc2201