Table of Contents

Welcome to Week 1

In the first week of this course, we will cover the course details, description, outline, software, general overview, as well as installing the software, creating our first project.  We will learn the basics of coding in Java, versus Python, and discuss in detail the concept of learning to program, versus learning Java or any other specific language.

The overall concept of Object Oriented Programming, what it is, and why is it so very important will be a major theme this week.

Topics

Class 1

Class 2

Class 3

Break

Object Oriented Programming Basics

Introduction to Java and the IDE

Creating our first Project (Hello World)

Project Output Configuration

Style Guide

Commenting Expectations

Practice Exercise (not for submission)

Assessments

There are no assessments being given or due in week 1.


What is Java?

Java is a popular object-oriented programming language that was originally released in 1996.  Java allows you to create everything from applets embedded in web pages, to large scale applications that run on any platform in which Java is supported..  You can run Java programs on a variety of computers using a range of operating systems.  This is called cross-platform compatible.

Java is robust, portable, dynamic, and uses a multi-threaded architecture.  You will learn more about these properties as the term goes, and as you continue through your educational journey.

The Java Environment

A Java program runs on the Java Virtual Machine (JVM), which is part of most modern operating systems today.  A compiler converts the Java source code into a binary program consisting of byte codes.  When a Java program is executed, the Java Interpreter inspects the byte codes and executes the actions the byte codes specify within the JVM.  The Java interpreter sites between the program and the physical machine, which prevents unauthorized actions in the program from being executed.

The compiler is part of the JDK, Java Development Kit, that is required to be installed when writing Java code such that it can be compiled.

Java Program Structure

A Java program is always made up of one or more classes, where each class is a separate file with a .java file extension.  Files are linked together through the project, sometimes requiring importing, this depends on the IDE (Integrated Development Environment) used.  In IntelliJ IDEA, there is no need to import files, they are automatically linked within the IDEA when they are created.

Every Java application contains a void method called main() that defines the starting place for executing the code.

Other classes, methods, and other objects are then referenced in sequence starting from the main() method.  Your professor will do a demonstration of this in class and show you live how it works!

Popular Applications Written using Java

The following applications are written in Java:

A sample of Java Code


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

This might look a little bit cryptic now, but no worries, we will get you up to speed soon!

This program simply outputs the string "Hello, World!" to the console window. But there's a lot more going on here under the covers: