Java is a high-level, cross-platform, mature, object-oriented programming language. Java is extremely popular due to its flexibility and ability to run anywhere. It abstracts away a lot of details that we don't need to worry about which allows us to focus on the logic in our code.
Prerequisites
- A computer that can install and run Java.
- A desire to learn how to code!
If you've got these two things, you're ready to start this class!
Installing Java
To install Java if you don't already have it installed, head on over to the Java homepage to get your copy.
The very modern looking Java homepage.
To test that you installed Java correctly, run this command:
BASHjava -version
You should get an output similar to this:
BASHC:\Users\Sabe>java -version
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
If you have Java installed, you're good to go.
Installing a Java IDE
You will most likely need a Java IDE to write, compile and run your Java code, at least if you don't want to do all of this in the command line. There are many Java IDEs to choose from, including IntelliJ IDEA, Eclipse, and NetBeans. We recommend IntelliJ IDEA but the choice is entirely yours. At this point, we will assume you either have an IDE or are capable of doing it all in your command line. Either way, let's move on to writing Java code!
Hello World
The classic example to starting any programming language has got to be printing out Hello World!
, so let's do just that in Java:
JAVApublic class Main {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
BASHHello World!
If you see the words printed, you have everything you need to continue on with this class on Java!
You, excited to start coding Java!
Resources
- Getting Started with TypeScript
- Getting Started with Svelte
- How to Serve Static Files with Nginx and Docker
- Best Visual Studio Code Extensions for 2022
- How to build a Discord bot using TypeScript
- How to deploy a PHP app using Docker
- How to deploy a MySQL Server using Docker
- How to Scrape the Web using Node.js and Puppeteer
- Getting Started with Handlebars.js
- Build a Real-Time Chat App with Node, Express, and Socket.io
- Getting User Location using JavaScript's Geolocation API
- Learn how to build a Slack Bot using Node.js