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.
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 |
Commenting Expectations Practice Exercise (not for submission) |
There are no assessments being given or due in week 1.
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.
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.
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!
The following applications are written in Java:
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:
public class HelloWorld
- This is like the door to your program. This tells Java that a new public class is being created (a kind of blueprint) named HelloWorld. All Java applications must have at least one class.public static void main(String[] args)
- This is the starting point of all Java applications, where the execution begins when the run button is pressed.System.out.println("Hello, World!");
- This is teh actual code the is going to be run. This command instructs Java to print "Hello, World!" to the console window.