Learn Java Programming: The Definitive Guide
Learn Java Programming: The Definitive Guide
Learn Java Programming: The Definitive Guide
This guide will provide everything you need to know about Java programming
language before you learn it. More specifically, you will learn about features of
Java programming, its applications, reasons to learn it, and how you can learn it
the right way.
TABLE OF CONTENTS
Java Tutorial
What is Java Programming?
Java Terminologies
Run Java On Your Computer
Your First Java Program
Recommended Java Books
Before getting started on Java programming, lets get familiarized with the
language first.
Why Java was Created? A Brief History
Java was built with the philosophy of "write once, run anywhere"
(WORA). The Java code (pure Java code and libraries) you write on
one platform (operating system) will run on other platforms with no
modification.
2. An object-oriented Language
3. Java is fast
The earlier versions of Java were criticized for being slow. However,
things are completely different now. The new JVMs are significantly
faster. And, the CPU that executes JVM are also getting more and
more powerful.
4. Java is secure
Applications of Java
Learning a new programming language can be challenging. You will hear a lot of
new terms which can be overwhelming for a newbie. So, we have decided to
explain a few terms that you are likely to hear in the world of Java programming
language.
Note, this is not the complete list of Java Glossary. Instead, it's the list of terms
you should know before you start learning Java programming.
Java 8 - Java 8 is the latest major release for Java. Our Java tutorial will include
all major features of Java 8.
Java EE, Java ME and Java SE - Java EE, Java ME and Java SE stands for
Java Platform Enterprise Edition, Micro Edition, and standard edition respectively.
Java EE is targeted for applications which run on servers. Java ME is targeted for
resource limited devices like: embedded devices. And, Java SE is the basic Java
environment used for creating standard programs.
If you are a java programming newbie, we recommend you to start with J2SE.
JVM - JVM (Java Virtual Machine) is an abstract machine that enables your
computer to run a Java program.
JRE - JRE (Java Runtime Environment) contains JVM, supporting libraries, and
other components to run a Java program. However, it doesn't contain any
compiler and debugger.
JDK - JDK (Java Development Kit) contains JRE and tools such as compilers
and debuggers for developing Java applications.
To run Java Programming in Windows, you'll need to install two things: JAVA SE
Development Kit (JDK) and IDE to create your Java Projects.
3. After download, open the setup file and follow the instructions. Click
Next. Select all features by selecting "This feature will be installed
on local hard drive" and copy the installation location (highlighted
by yellow) in a Notepad. And, click next again.
5. Now, you need to edit the PATH variable. Go to Control Panel >
System and Security > System. Click on Advanced system
settings on the left to get System Properties window.
6. Click on Environment Variables. Then, on the lower System
variables section, find Path and click Edit to the following window.
7. Copy the whole text and paste it in Notepad. This will make it easier
for you to edit and check. Check if the text already
contains C:\ProgramData\Oracle\Java\javapath;. If yes, you can
go to the next step. If no, copy the earlier copied installation
location in the front and append bin; to the end like: C:\Program
Files (x86)\Java\jdk1.8.0_112\bin;. For you, the JDK
version jdk1.8.0_112 might be different. Copy the text again and
paste it in the earlier PATH edit window.
3. After download, open the setup file and follow the instructions (Next
> Next). Then, create Desktop shortcut for 64-bit launcher, and add
associations for .java(Select the ones you want). Click Next again
and Install.
5. Select Do not import settings and click Ok. Then, accept the
Jetbrains Privacy Policy by clicking Accept button.
6. IntelliJ IDEA will now allow you to customize its interface. You can
skip all and set defaults, or choose your custom changes. If you're
unsure, just click Skip All and Set Defaults.
8. In the next window, select Java on the left window and click New at
the top to select JDK. Here, select the installation location of the
JDK we copied during the Java installation.
9. IntelliJ IDEA now recognizes the JDK installed. Don't check any of
the options below and click Next.
10. Now, write the name of your project: HelloWorld (or anything you
want) and click Finish. If it says the directory doesn't exist, just click
Ok. (If you don't see a sidebar on the left of the window, Go to View
> Tool Windows > Project).
11. Now, to add a new Java class, select src folder on the left > right
click > New > Java Class. Write the name of your class. Make sure
you don't have spaces in the class name.
13. To run the program, go to Run > Run... Then, click on HelloWorld
(or your project) which will build the executable file and run it.
Your First Java Program
2. Go to File > New > Project... > Java (on the left navigation)
3. Give the Project Name. We will call it Hello World for now and
click Finish
13. Finally, hit run button. If everything goes right, you will see Hello,
World! output on the screen.
To learn in detail on how this program works, visit Java Hello World program.
How to Learn Java?
We are working really hard to create easy to follow Java tutorial. Subscribe now
and once the tutorial is complete, you will be the first one to know.
Our tutorials are designed for beginners who do not have any prior knowledge of
Java. Each tutorial is written in depth with examples and detailed explanation.
Oracle, the company that owns Java, provides quality Java Tutorials. The Java
tutorial describes the features in Java SE 8, and is continuously updated to keep
up with changes to the Java Platform.
Note: Official Java Documentation may not be the easiest of the tutorials to
follow.
If you are serious about learning programming, you should get yourself a good
book.
Granted, reading a 1000 page book takes a lot of time and patience. However,
following a good Java book will help you learn Java programming, the way it
should be learned.
One of the best Java books every Java programmer should get. That being said,
this book doesn't cover features of Java 8.
Get this book
Don't want to search pages and pages to look for a small information? Get this
book.
Get this book
You must be eager to learn Java by now. However, here are some tips, and best
practices to follow before you learn Java.
Don't read Java tutorials and examples like a novel. The only way to
get better in programming is by writing a lot of code.
Learn Java language the right way. If you are switching from another
programming language (let's say C#), don't write C# style code in
Java. Also, check this article on How to write good Java code?
Join Java communities. Once you get the hang of writing simple Java
programs, join Java communities and forums. Then, try to solve other
programmer's Java problems. It's a good way to expand your Java
knowledge. Also, you can get help when you are stuck.
I hope this article has encouraged you to learn Java, and helped you to get
started. There is no reason to wait now. Let's explore the world of Java
programming language.
Java Tutorial
INTRODUCTION
FLOW CONTROL
Java if...else
Java switch Statement
Java for Loop
Java for-each Loop
Java while Loop
Java break Statement
Java continue Statement
OTHER TUTORIALS
Coming Soon!
We are working hard to create easy to follow step by step Java tutorial. Subscribe
now, and we'll let you know once the tutorial is complete.