CS1120 Java Lab Guide
We have prepared a 40-minute screencast introducing Java and working through the Java Problems found in Problem Set 5. You should treat this as a "small lecture" introducing you to Java: after watching the whole lecture, you will be ready to solve problems in Java.The videos are quite detailed and serve as a comprehensive walkthrough for the getting started with Java and the questions in Problem Set 5. You might follow along with this video at the same time that you read the PS5 Java problem descriptions.
The are three "main parts" of the video:
- Openining Eclipse, Creating new Projects
- Printing "Hello, World."
- Sorting and ArrayLists
- #1. Starting Eclipse, Workspaces, Opening Files, Making a Class
- #2. The main Method, Printing "Hello, World", Running a Java Program
- #3. Making a new ArrayList, Eclipse Warnings, Import Statements
- #4. Adding Elements to an ArrayList, Defining Other Functions, Return Types, Setting up Insertion Sort
- #5. Java for Loops, Adding Elements to a Sorted ArrayList
- #6. Java else if, Staying Within Array Bounds
- #7. Stepping Through Inserting One Element Into a Sorted ArrayList (Less Confusingly)
- #8. Debugging Example, Finishing and Testing Insertion Sort For an ArrayList
Java and Eclipse on Your Machine
Officially we only support Java on the Lab machines in OLS 001, where everything already works perfectly out of the box.Here are some instructions that may work for installing Java and Eclipse on your machine. If they don't work, you should use the lab machines (we can't help you).
- Install a Java Virtual Machine (JVM) such as the Java Runtime Environment (JRE) or the Java Development Kit (JDK).
- Install Eclipse.