01 Java Fundamentals | Introduction to Java | By Dummy for Dummies

Java Introduction | Hassan Bukhari
Java Notes

01 Java Fundamentals | Introduction to Java | By Dummy for Dummies

Java Beginner Guide Programming Fundamentals

INTRODUCTION

I'll explain everything the way I learned it, step by step, assuming we're all figuring this out together. So I'll start from a point where everything will make sense.

The college syllabus file contains many things like "Computer Programming Concepts & Paradigms" and "Errors" this and that… we won't be talking about any of these.

Act like we all share a single brain cell. So all you need to do is follow along. I'll be explaining only the important things.

WHAT IS JAVA?

The world of computers is a magical one, here you can create whatever you want. And programming languages are like magic spells, some are dark, some are simple, some are hard yet powerful.

Java is just another magical language. You tell the computer what to do, and the computer does it all, whether it's creating a game character, making it walk, or reading some files. It does everything.

Think of it this way: You speak to the computer in Java, and the computer listens. Every single time.

WHY CHOOSE JAVA?

Monkey loves banana, monkey gets banana, monkey happy.

You love money, you get money, you happy. Over 3 billion devices run on java. Java programs run on any device. So you write your code once, and it works on different systems, Windows, macOS, Linux, Android, without changing a thing. This much praise is enough for now.

So to make money as a CS student, Java is one of the best entry points (not the only best though). To understand why I love Java, let's compare it with two other languages: Python and C++.

PYTHON
Like when someone asks you how to drive a car, and you tell him: "This is the accelerator, press it and boom, it is driving."
Great for machine learning, very easy to start, but sometimes too easy. You miss important programming concepts early on.
C++
Like when someone asks for a driving lesson, and you start giving lectures about how the engine works and how to customize your own engine.
Brilliant, and once you know it you can understand any vehicle later, but too much for a beginner.
JAVA
Like teaching a person: "This is a car. These are the pedals. It drinks petrol. This is how you drift. This is why it needs water also."
With Java, you know 80% of how engines work. After learning Java, every other language will repeat at least 80% of the same concepts.

HOW TO RUN JAVA?

To run Java, you need the Java Development Kit (JDK). Think of the JDK as Dumbledore of Java magic:

  • You write code.
  • Dumbledore translates it into something the machine understands.
  • Then Dumbledore runs it on your machine.

There is also something called the JVM, but for now I'll only explain what we're doing, no need to waste our single brain cell.

After downloading the JDK from the internet and installing it on your PC, you'll need to set PATH for it. Imagine Dumbledore needs his dictionary to translate and a manual to run your code. You store the location of his tools in your PC memory. Every time you ask Dumbledore to work on a code, he uses that location to bring his tools and then works on the code. Without tools, Dumbledore is useless.

The tools are:

  • javac → Dumbledore's dictionary, used for translation (called a compiler).
  • java → Dumbledore's manual, used for running code (called an interpreter).
Where to write code? You can even write Java in a .txt file, but I would recommend using VS Code. Download it from the internet and install it free of cost. It has many features that you will learn to use with time.

CLOSING

That's it for the introduction! In the next blog, we'll understand our very first program in Java the Hello World!