Java Curriculum
Java Curriculum
Show or hide details about course Java Programming: Solving Problems with Software
WEEK 1
Welcome to “Java Programming: Solving Problems with Software”! We are excited that you are
starting our course to learn how to write programs in Java, one of the most popular programming
languages in the world. In this introductory module, you will get to meet the instructor team from
Duke University, have an overview of the course, and hear from Google engineers about why they
find programming exciting and why Java is important. Have fun!
In this module, you will learn to design and run your first Java programs, including one program that
prints “Hello!” in various countries’ languages and another where you will copy and edit many files
by converting color images to grayscale. To accomplish these tasks, you will learn about classes
constructed for this course: Iterables libraries that allow you to perform the same task over multiple
lines in a document or webpage or multiple files within a directory. By the end of this module, you
will be able to: (1) Download and run BlueJ, the Java programming environment for this course; (2)
Access the documentation for the Java libraries specially designed for this course; (3) Edit, compile,
and run a Java program; (4) Construct for loops in Java; and (5) Use Iterables to run a program that
iterates over multiples lines in a document or webpage or multiple files in a directory.
Video · Finding Bugs In Code: Applying the Scientific Method to Fix Programs
WEEK 2
Strings in Java
This module begins with a short presentation from Raluca Gordân, an assistant professor in Duke
University’s Center for Genomic and Computational Biology, about an important problem genomics
scientists encounter regularly: how to identify genes in a strand of DNA. To tackle this problem, you
will need to understand strings: series of characters such as letters, digits, punctuation, etc. After
learning about Java methods that work with strings, you will be able to find genes within a DNA
string as well as tackle other string related problems, such as finding all of the links in a web page. By
the end of this module, you will be able to: (1) Use important methods for the Java String class; (2)
Use conditionals, for loops, and while loops appropriately in a Java program; (3) Find patterns in the
data represented by strings to help develop the algorithm for your program; (4) Understand the
importance of designing programs that keep different data processing steps separate; (5) Use the
StorageResource iterable for this course to store some data for further processing; and (6) Rely on
Java documentation to better understand how to use different Java packages and classes.
Video · Introduction
WEEK 3
A common format for storing tabular data (any data organized into columns and rows) is in comma
separated values (CSV) files. In this module, you will learn how to analyze and manipulate data from
multiple CSV data files using a powerful open-source software package: Apache Commons CSV.
Using this library will empower you to solve problems that could prove too complex to solve with a
spreadsheet. By the end of this module, you will be able to: (1) Use the open-source Apache
Commons CSV package in your own Java programs; (2) Access data from one or many CSV files using
Java; (3) Convert strings into numbers; (4) Understand how to use “null” in Java programs (when you
want to represent “nothing”); (5) Devise an algorithm (and implement in Java) to answer questions
about CSV data; and (6) Analyze CSV data across multiple CSV files (for example, find maximums,
minimums, averages, and other simple statistical results).
WEEK 4
This module wraps up the course with a mini project that ties together the different practices, skills,
and libraries you have gained across the course! Using data on the popularity of different baby
names in the United States from the past several decades, you will be able to compare different
names’ popularity over time. While the data we have collected for this course is from the United
States, we welcome you to share data from other countries in the course discussion forums. Good
luck with the mini project!
COURSE 3
Show or hide details about course Java Programming: Arrays, Lists, and Structured Data
WEEK 1
Welcome
Welcome to “Java Programming: Arrays, Lists, and Structured Data”! We are excited that you are
starting our course to learn how to write programs in Java, one of the most popular programming
languages in the world. In this introductory module, you will hear an overview of this course and be
introduced to the supporting resources available.
Video · Welcome
Reading · Programming Resources
In this module, you will learn about the basics of cryptography, the science of keeping information
private and secure. You will learn about simpler cryptographic systems, which were used from the
Roman Empire through the early 1900s. You will learn how to implement these ciphers, as well as
how to break them. To solve these problems, you will work more with processing Strings, but also
learn about arrays—a way to store an indexable sequence of elements. You will be able to: (1)
combine Strings using concatenation; (2) build Strings within a Java program using StringBuilder; (3)
use arrays to store and manipulate collections of data; (4) refactor your programs for improved
organization using object-oriented principles; (5) and practice effective algorithm design.
Video · Introduction
Video · Summary
Video · Introduction
Video · Arrays
Video · Summary
Reading · Programming Exercise: Breaking the Caesar Cipher
Video · Introduction
Video · Fields
Video · Visibility
Video · Constructors
Video · Summary
Quiz · Cryptography
WEEK 2
After completing this module, you will be able (1) to program a word frequency counter to analyze
any input text file, (2) to select and substitute words from a list into a document template using both
ArrayList and HashMap, (3) to create new lists to use in templates, (4) to recognize brittle code, and
(5) to improve code with flexible, object-oriented design. You will gain these skills in the framework
of developing a randomly generated story that we call GladLibs. You may discover that bald lions
change peoples’ lives, or that fluffy dinosaurs get things done in a jiffy. We hope you have fun
developing your Java skills this week!
Video · Introduction
Video · ArrayList
Video · Summary
Video · Introduction
Video · HashMap
Video · Summary
Quiz · GladLibs
WEEK 3
In this module, you will learn about how web server logs store information about visitors to a
website, and you will write programs to access information like user IP address, date and time of
access, and more. Using Java programs you write in this module, you will be able (1) to read
information from a web server log, (2) to count the number of unique visitors to your website, and
(3) to count the number of times each visitor uses your website.
Video · Introduction
Video · Summary
Video · Equality
Video · Summary
Video · Introduction
Video · Summary
WEEK 4
In this module, you will develop a program to break the Vigenère Cipher, a more complex version of
the Caesar Cipher. You will improve your program in three stages: first decrypting messages where
you know the language and key length, then adding the capability to handle messages with unknown
key length, then extending the program to handle messages in a range of possible languages.
Through this project, you will be able (1) to effectively use HashSet and HashMap, (2) to expand an
algorithm from solving a simpler problem to handle broader, more complex problems, and (3) to
design and modify program code involving a more complex collection of classes, methods, and data.
Video · Introduction
COURSE 4
Commitment
Subtitles
English
4. Break problems into multiple classes, each with their own methods;
5. Determine if a class from the Java API can be used in solving a particular problem;
8. Appropriately hide implementation decisions so they are not visible in public methods; and
10. Recognize standard Java classes and idioms including exception-handling, static methods,
java.net, and java.io packages.
Show or hide details about course Java Programming: Principles of Software Design
WEEK 1
Welcome to “Java Programming: Principles of Software Design”! We are excited that you are starting
our course to learn how to write programs in Java, one of the most popular programming languages
in the world. In this introductory module, you will hear an overview of this course and be introduced
to the supporting resources available.
Video · Welcome!
In this module, we will introduce a data set containing details about earthquakes around the world.
You will learn how to pull this data into a program, search through the data, and filter the data based
on desired criteria. By the end of this module, you will be able to (1) write programs that include
multiple classes and ArrayLists of class types, (2) find the maximum value in an ArrayList, (3) use a
Filter interface to search through data, (4) implement interfaces with method signatures, and (5)
combine several filters together.
Video · Introduction
Video · Introduction
Video · MatchAll
Video · Summary
WEEK 2
In this module, you will continue using real earthquake data to explore several sorting algorithms.
You will learn how to implement a selection sort and a bubble sort, then be introduced to a Java
method Collections.sort, which sorts with much greater efficiency. By the end of this module, you
will be able to (1) implement several sorting algorithms from scratch, (2) use efficient pre-existing
sorting classes, (3) modify a class’s compareTo method to choose the criteria by which objects of
that type are ordered, and (4) write classes that implement the Comparator interface to create
interchangeable sorting criteria.
Video · Introduction
Video · In Place
Video · Efficiency
Video · Summary
Video · Introduction
Video · Comparable
Video · Comparator
Video · Summary
WEEK 3
In this module, you will explore some of the underlying concepts of predictive text. The first lesson
will introduce random character generation and then how to train the character selection based on
an input text. The second lesson will extend this concept to complete words. By the end of this
module, you will be able to: (1) base random text generation on the frequency of characters in a
training text, (2) collect a set of characters that occur in a text after randomly chosen initial
character(s) to create a semi-random text, (3) extend the predictive text generation to use whole
words, and (4) implement your own .equals method to compare complex data types.
Video · Introduction
Video · Introduction
Video · Summary
WEEK 4
As you reach the end of this series, you may wish to extend your Java experience to tools beyond
those provided here. This module will cover some of the Java basic information that is needed to
program without BlueJ or the edu.duke library. After completing this module, you will be able to: (1)
write a main method to start a Java program in any programming environment, (2) use the “static”
keyword to modify fields, (3) find alternative editors to use with Java, (4) use exceptions to debug
your program and make it more robust, and (5) reference Java libraries that are necessary to read
files without the edu.duke library.
Video · Editors
Video · Summary
Video · Introduction
Video · Summary
COURSE 5
Commitment
Subtitles
English
3. Calculate how similar a given rater is to another user based on ratings; and
Show or hide details about course Java Programming: Build a Recommendation System
5. WEEK 1
You will start out the capstone project by taking a look at the features of a recommender
engine. Then you will choose how to read in and organize user, ratings, and movie data in
your program. The programming exercise will provide a check on your progress before
moving on to the next step.
WEEK 2
Simple Recommendations
Your second step in building a recommender will focus on making simple recommendations
based on the average ratings that a movie receives. You'll also make sure that each
recommended movie has a least a minimal number of user ratings before including it in your
recommendations. Throughout this step you are encouraged you use your knowledge of the
seven step process to design useful algorithms and successful programs to solve the
challenges you will face.
Reading · Module Description
WEEK 3
In your third step, you will be encouraged to use interfaces to rewrite your existing code,
making it more flexible and more efficient. You will also add filters to select a desired subset
of movies that you want to recommend, such as 'all movies under two hours long' or 'all
movies made in 2012'. You'll also make your recommendation engine more efficient as you
practice software design principles such as refactoring.
WEEK 4
Weighted Averages
In your fourth step, you will complete your recommendation engine by finding users in the
database that have similar ratings and weighting their input to provide a more personal
recommendation for the users of your program. Once you complete this step, you could
request ratings of movies from those you know, run your program, and give them
recommendations tailored to their own interests and tastes!
Farewell
Creators
Duke University is consistently ranked as both a top undergraduate and research
institution, with world class faculty at all levels in undergraduate, graduate, and
professional schools.
Owen Astrachan
Andrew D. Hilton
Professor of the Practice
Assistant Professor of the Practice
Susan H. Rodger
Robert Duvall