How to learn Java Programming

Java is one of the most used programming languages in the world for developing the desktop application and web application.It has completed 22 years in the programming world.

In this post, we will see how to learn java programming in depth and in most efficient way.

Java has a huge learning curve, it is a complete programming language with lots of classes, APIs etc. Don’ try to learn everything at once, go step by step and master Java programming world.

Ways to learn Java Programming:

Read books:

There are many good books from which you can learn Java Programming.
Some of them are:

  • Head first Java
  • Effective Java
  • Thinking in Java

Head first Java is my favorite among all. I really liked head first Java and enjoyed reading it.Head first Java explains Java Concepts in very unique and interesting way. You will be able to learn Class, Object, Thread, Collections and Generics and various other concepts.

Join a Video Course:

There are many good video courses from which you can learn Java programming. It will help you to learn Java at a good pace.

Some of the good  online courses are:

Simplilearn is my favorite among all.

They provide a 90-day 2+Instructor-led training course to learn and master the basic and advanced concepts of core Java & Java EE. This really helps to get acquainted with frameworks like Hibernate & Spring, and understand SOA.It is good investment to learn Java programming quickly and efficiently.

Follow good Java blogs:

There are many good online blogs/website from which you can learn Java easily.

Some of them are:

I have created a complete tutorial for beginners and experienced programmers which will help you to learn Java Programming.

Tips to learn the internals of Java:

Understand Java basics:

It is always essential to understand basics of any language when you get started. You need to understand basic concepts of Java such as classes, objects, packages, variables, keywords, data types etc.

Think in Object oriented way:

As you know Java is an Object oriented programming language, you need to understand object oriented concepts such as abstraction, encapsulation, polymorphism, and inheritance.

You need to think in terms of object and class. For example Employee has attributes such as name, age, and behavior such as completeAssignment etc.

Master Collections:

Collections framework is the most used framework in Java.Don’t just understand the usage of collections such as HashMap, HashSet, TreeMap, Treeset but also understand internal working of Collections.

For example: If you know internal working of HashMap and then it is easy to debug program and see the content of HashMap. It will also help you understand how Java collections are designed.

Let’s take a very simple example. I have a Country class, we are going to use Country class object as key and its capital name(string) as value. Below example will help you to understand, how these key value pair will be stored in hashmap.


If you want to understand more about hashcode and equals method of object, you may refer hashcode() and equals() method in java

2. class)

Now put debug point at line 24 and right click on project->debug as-> java application. Program will stop execution at line 24 then right click on countryCapitalMap then select watch.You will be able to see structure as below.
How HashMap works in java
Now From above diagram, you can observe following points

You have put 4 entries in HashMap but you see only two entries in Entry[] array. If you want to understand why there are only two entries in Entry[] array, you need to understand How HashMap works in java and Hashcode and equals method.

This is a very simple HashMap example but you might much more complex example in real life, hence to debug the prgoram and see values in HashMap, it is essential to learn the internal working of HashMap.

Choose any IDE:

You can choose IDE such as Eclipse, intellij or Netbeans. It will help you to do programming faster and will inturn increase your efficency. You should also learn some improtant keyboarad shorts for that IDE.

For example:

When you copy any code and put any code in eclipse, you need to import all import statements for that program, you can simply use control+ shift+ O in eclipse and it will take care of imports. Hence it will help you to increase your efficiency while programming.

Write Basic Programs:

Practice basic java programs on String, Numbers and Array etc. It will help you to write simple logics.

Practice at HackerRank:

Once you are familiar with collections and object oriented concepts, you can practice Java programming at HackerRank. it will help to master syntax and building logic.

Learn Multithreading:

It is quite hard to master Multithreading.It requires good amount of practice to learn multithreading as thread outputs are unpredictable in most of the cases. You can learn basics of threads such as how to create a thread, life cycle of thread and different method of Thread class such join, sleep, yield and thread synchronization.

Once you are comfortable with basics of thread, learn executor framework. Java 5 has introduced executor framework which takes care about thread creation and management, you can just concentrate on business logic.

Create small Projects:

You can create simple projects of your choice such as Library Management, Transport system. Create a simple design, Identify major entities, use cases and write a Java application to solve the program.

Browse some good Projects on github:

There are many good open source projects on GitHub. You can browse some good projects, it will help you to understand some good practices on design and coding.

Learn design pattern:

It is always a good idea to learn some design patterns. Learn few design patterns and apply it in Java applications.

For example: Observer design pattern depicts publisher-subscriber relationship.You can identify use case and easily implement it in Java program.

Practice, Practice, and Practice:

There are no shortcuts to learn Java. If you want to become a good Java developer, you need to practice more and more.

That’s all about How to learn Java Programming. If you have more suggestions, please do comment.

Related Posts

  • Check if Object is null Java
    14 March

    Check if Object Is Null in Java

    Table of ContentsComparison Operator to Check if Object Is Null in JavaisNull() Method to Check if Object Is Null in JavanonNull() Method to Check if Object Is Null in JavarequireNonNull() Method to Check if Object Is Null in JavaConclusion An object in Java is an instance of a class. It is a real entity existing […]

  • How to print multiple variables in java
    31 January

    How to Print Multiple Variables in Java

    Table of ContentsWays to Print Multiple Variables in JavaUsing System.out.printUsing System.out.printfPrint Multiple Variables in Java Using LoggerFrequently Asked QuestionsHow Do I Print Multiple Values on One Line in JavaHow to Print Multiple Integers in JavaHow to Print String and Integer in Same Line in Java In this post, we will see how to print multiple […]

  • What is == in java
    01 December

    What is == in java

    Table of ContentsWhat is meaning of == in JavaCode example of ==Object equality using equal to ==The difference between == and equals== in EnumConclusion In this tutorial, we will learn what is == in Java as it is a common lexeme that we will use while developing applications. The == lexeme can be confused with […]

  • Multiple classes in one file in Java
    18 October

    Multiple classes in one file in Java

    Table of ContentsIntroductionMethods to Implement Multiple Classes In One Java Program1) Nested classes2) Multiple non-static nested classes In this post, we will see how to have multiple classes in one file in java. Introduction You need to have any number of classes in a single Java file, but there is a restriction that you can […]

  • Break out of nested loop in java
    22 July

    How to break out of nested loops in Java

    Table of ContentsUsing break (will break inner loop)Using named loopUsing named blockUsing returnConclusion In this post, we will see how to break out of nested loops in Java. Using break (will break inner loop) It is very important to understand how nested loops work to ensure that applying break will output the desired result. If […]

  • public static void main(String args[]) - Java main method
    11 June

    public static void main(String[] args) – Java main method

    Table of ContentsWhy is the main method so important?SyntaxExplanation of the KeywordsExamples of Java main method ProgramsSimple Java ProgramPassing arguments in the main methodNon-Public main method.Defining a return value for the main methodOverloading the main methodQuestionsCan we run java without main method?Can we have more than one main method in classConclusion If you have worked […]

Leave a Reply

Your email address will not be published.

Subscribe to our newletter

Get quality tutorials to your inbox. Subscribe now.