Getting Started With Java

Dhanam Parekh
Javarevisited
Published in
4 min readOct 13, 2020
Google Image

Why Java?

Java is a highly popular programming language that was developed in 1995 by James Gosling. Even though Java is quite old, it continues to be a top language to be learnt for development purposes.

The main features of Java are:

  1. Platform Independent / Portable: Java is a platform independent language unlike other languages including C and C++. This is due to the fact that the code is compiled into platform-independent byte code rather than platform-specific machines.
  2. Object-Oriented: Java is an object-oriented language which means that everything in Java is based on Objects and Classes. This helps in solving complex problems easily using the Object-Oriented methodology.
  3. Multithreading: This feature allows developers to build applications where tasks can be performed simultaneously and thus, ensure that the applications run smoothly.

Java, being a versatile language, can be used to develop:

  1. Android Applications
  2. Desktop Applications
  3. Enterprise Applications
  4. Web Applications

With all these features and uses, learning Java is a top priority for developers. Now without further ado, let’s dive into how to get started.

Step 1: Get acquainted with the Syntax.

Learning how to program a “Hello World” in a particular programming language is analogous to learning alphabets for learning a human language.

This is how we write the program in Java

class Tutorial{
public static void main(String[] args){
System.out.println("Hello World");
}
}

Start with learning the meaning and importance of each keyword in the above block of code, why do we use it and when do we use it.

Below websites will help you cover the basic syntax and theory required to move on to the next step. I would recommend having a basic understanding of conditions, loops, data types, methods, etc.

Step 2: Start Coding

Google Image

Just learning the keywords and theory won’t help you much. What you need is a constant practice. There are various websites that will help you here.

Personally, I find CodeGym to be the best website to start learning how to code in Java. It starts with very basic programs to help you understand and the difficulty increases as you move on to higher levels.

Once you get a basic hold on how to write code in Java, you can start solving problems in the below-given websites.

  1. https://www.hackerrank.com
  2. https://codingbat.com/java
  3. https://leetcode.com

Step 3: Learn Object-Oriented Programming

As discussed above, Object-Oriented Programming (OOP) is one of the main features of Java. This also constitutes a major part of most of the technical interviews.

Object-Oriented Programming helps you to define a problem statement in terms of objects and classes.

There are four main pillars of OOP

Google Image
  1. Inheritance: Inheritance is a principle with the help of which one class can inherit properties and behavior of another class. The class which inherits the properties is called child class/ subclass. The class from which the properties and attributes are inherited is called parent class/ base class. Inheritance helps in promoting code reusability.
  2. Abstraction: Abstraction is a principle which helps to hide non essential code and only show essential code to the client/user. Abstraction in Java can be achieved using Interfaces and Abstract Classes
  3. Polymorphism: Polymorphism in Java refers to an object having multiple forms. There are two types of Polymorphism, Runtime/dynamic polymorphism and Static/ Compile time polymorphism.
  4. Encapsulation: Encapsulation is a principle which involves hiding data such that it cannot be accessed from outside the class and hence keep the application secure.

Below are some good resources to learn them in detail.

https://beginnersbook.com/2013/04/oops-concepts/

https://www.javatpoint.com/java-oops-concepts

Step 4: Start Developing

Until now, you know good amount of theory and how to solve basic problems. In order to further improve your command over the language, you need to start developing and building projects in Java. There are various applications where Java is used as listed above. You can pick any one and start developing.

For example: You can start developing Android applications by installing Android Studio. Adding a good resource to get you started.

Step 5: Read Books:

This is no mystery. In order to master any topic, you need to read a lot of books. There are many good books available for learning Java which will expand your knowledge whether you’re a beginner or an expert.

Most Popular one’s are:

  1. Beginning Programming with Java For Dummies
  2. Head First Java
  3. Think Java

here are some more

Conclusion:

Following the above mentioned steps will help you reach an intermediate level. To master the programming language, it will require commitment and sheer dedication . The question is, are you willing to put up the efforts for it?

--

--