Resources
- Course notes
- Java
- Interactive development environments (IDEs)
- Programming advice and resources
- Computer labs
- Support services
Course notes
Course notes for individual lectures and recitations can be found on the course schedule. The notes are also available as a single printable document.
Java
Java is one of the most widely used object-oriented programming languages, and programming skill in the Java language is in high demand. Nevertheless, this is not a course about Java. Java is simply a good vehicle for explaining many of the ideas on data structures, algorithms, and software engineering that will be covered in the course. Most of the ideas you will be exposed to in this course, and the skills you will develop, will transfer to other programming languages.
Online Resources
• The CS 2110 Java HyperText is a comprehensive collection of online modules introducing Java and Eclipse.
• The Java API contains documentation for the extensive Java class library.
• The Java Language Specification is helpful if you want to really understand how Java works.
• Oracle has an official Java Tutorial.
Brushing Up
Review the introductory chapters in the textbook and the Java reference books listed on the course info page. For students with C++ experience, check out this Wikipedia page comparing C++ with Java.
Java version
We will be using the Java 10 Standard Edition (Java SE 10) platform, which consists of the Java Development Kit (JDK) and the Java Runtime Environment (JRE). Java 8 (aka 1.8) or 9 will also suffice. If you are using Java 7 or earlier, please upgrade.
To find out which version of the JRE you are
running, open a command window (in Windows, Start > Run... and type cmd
,
and in Mac OS, Applications > Utilities > Terminal)
and type java -version
at the command prompt:
$ java -version java version "10.0.2" 2018-07-17 Java(TM) SE Runtime Environment 18.3 (build 10.0.2+13) Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)
This says I have version 10 installed.
If you are on a PC running Windows and have never installed a version
of the Java Development Kit (JDK) on your machine, you probably don't have it.
If you are on a Mac, you probably do. To find out, type javac -version
:
$ javac -version javac 10.0.2
If you get an error message or the version is earlier than 8, you must (re)install the JDK.
Installing the JDK
The JDK is already installed in CIT and ACCEL labs. However, installing it own your own machine will greatly facilitate your work.
To download the JDK, visit Oracle's Java web site and download and install the appropriate version of the JDK for your platform.
Compiling and Running from the Command Line
Compiling: Say your main class is MyProgram
and it is
contained in the source file MyProgram.java
.
If it is not in a package, navigate
to the folder containing MyProgram.java
and type javac MyProgram.java
. If it is in a package (say myPackage
), the
source should be in a folder called myPackage
. Navigate
to the folder containing myPackage
and type javac myPackage/MyProgram.java
.
Running: From the same folder you compiled from, type
java MyProgram <program arguments>
if it is not
in a package, and java myPackage.MyProgram <program arguments>
if it is.
Specifying a Classpath: Sometimes you may need to inform Java where to find auxiliary
classes. You can do this with the -cp
option
to the java
command.
Supply a sequence of folders telling Java where to look
for classes, separated by :
(Mac) or
;
(Windows).
Local Software
Some Java libraries have been developed for use in CS 2110 and CS 2112 assignments. Feel free to use them.
EasyIO
: Support for easy console input and output, and for scanning
input from a file or string (like java.util.Scanner
, but more powerful).
[ doc | jar | source ]
cs2110
: Various types of queues, including a priority queue supporting in situ adjustment of priorities;
a DelimitedStringBuilder similar to one found in OCaml; a module that runs an external script that takes a
string on stdin and writes a string to stdout; and a module for easy access to a text resource file.
[ doc | jar | source ]
IDEs
IDE stands for integrated development environment. The use of an IDE is the best way to develop Java programs. IDEs provide many valuable aids such as syntax checking, debugging, and refactoring that can save you a lot of effort.
There are many good IDEs. We recommend Eclipse, but you may use any one that you like, or none at all. Eclipse is installed in all the labs, along with some others. Early recitation sections will get you started with Eclipse if you are not familiar with an IDE.
Here are some links:
You should follow the 2110 style guide for naming conventions and code format. If you use Eclipse, you can download and install the Eclipse style template used by the course staff.
Programming
There are many valuable resources that can help you take your programming skills to the next level. Here are a few links:
General
Software Development Methodologies
Debugging
Just for Fun
- Please Don't Learn to Code
- Teach Yourself Programming in Ten Years
- Quines (Self-Reproducing Programs)
- Powers Of Ten
- Programming Quotes
- How To Become A Hacker
- How To Write Unmaintainable Code
- History of Operator Precedence
- Software Bugs & Glitches
- Doom for System Administration
- The International Obfuscated C Code Contest
- The Easter Egg Archive
- OOP Criticism
- Esoteric Programming Languages
Computer Labs
CIT Labs
Cornell Information Technologies (CIT) runs several computer labs across campus for all members of the Cornell community. The JDK and Eclipse are installed on these machines. Check here for locations and times of operation.
ACCEL Lab
You can also find the course software in the Academic Computing Center (ACCEL), located in the Engineering Library in Carpenter Hall. Any CS student may register for an account.
Support Services
Academic Excellence Workshops
The Academic Excellence Workshops (AEW) offer an opportunity for students to gain additional experience with course concepts in a cooperative learning environment. Research has shown that cooperative and collaborative methods promote higher grades, greater persistence, and deeper comprehension. The material presented in the workshop is at or above the level of the regular course. We do not require joining the AEW program, but do encourage students to join if they are seeking an exciting and fun way to learn. The AEW carries one S/U credit based on participation and attendance. The time commitment is two hours per week in the lab. No homework will be given. This is a wonderful opportunity for students to seek extra help on course topics in a small group setting.
Your fellow undergraduate students, who are familiar with the course material, teach the sessions with material that they prepare. The course staff provide guidance and support but do not actually teach the AEW course content or any session. A representative from the AEW program will be speaking about the program and registration procedures in lecture.
One of your TAs will be designated as the AEW liaison for CS 2112. Watch the announcements to find out who.
See the AEW webpage for further information.
Other Support Services
PROGRAM | DESCRIPTION |
---|---|
Registrar's Office | General services for the Cornell community. |
Engineering College | Support services for Engineering students. |
Arts College | Support services for Arts students. |
CIT | Services offered by Cornell Information Technologies (CIT), including computer training. |
Cornell Health | The Cornell University Health Service Center. For all health related concerns and counseling services. |
Learning Styles | Not everyone learns the same way. If you are curious about how you learn, check out this collection. |