Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

Treehouse

Java Basics Course

via Treehouse

Overview

In this course you will gain all the knowledge you will need to build an interactive command line program in Java. No prior programming experience is required. You will create an interactive game that prompts users for different parts of a sentence and then generates a story using those words.

What you'll learn

  • Write programs in the Java programming language
  • Use the console to interact with users
  • Use basic data types to store and name data
  • Use conditionals and looping to control program flow

Syllabus

Getting Started with Java

In this stage you will familiarize yourself with Workspaces, your programming environment for this course. We will learn about how to interact with the user using the console object. We will learn about variables, and more specifically, Strings.

Chevron 6 steps
  • Introduction to Your Tools

    7:30

  • Review: Introduction to Your tools

    3 questions

  • Strings and Variables

    6:58

  • Strings, Variables, and Formatting

    3 objectives

  • Receiving Input

    3:18

  • IO

    4 objectives

Using your New Tools

In this stage, you will learn how to add multiple formatters to a format string, and we will have a finished prototype. We will also cover what happens if and when you encounter errors.

Chevron 6 steps
  • Multiple Strings

    4:34

  • Multiple Format Strings

    3 objectives

  • Errors

    4:39

  • Errors

    3 questions

  • Coding the Prototype

    5:06

  • Fix the Errors

    4 objectives

Perfecting the Prototype

In this stage we will apply feedback we received and add feature enhancements to our prototype. We will add an age restriction and make sure that certain words are not allowed. We will explore branching and looping to solve common problems.

Chevron 10 steps
  • Reviewing Our Feedback

    6:11

  • Conditional ints

    3 objectives

  • Parsing Integers

    3:46

  • Parsing Integers

    1 objective

  • Censoring Words - Using String Equality

    4:51

  • String Equality

    2 objectives

  • Censoring Words - Using Logical ORs

    4:31

  • Using Logical ORs and ANDs

    5 questions

  • Censoring Words - Looping Until the Value Passes

    7:16

  • Looping until the value passes

    3 objectives

  • Extra Credit

    • There is a method on string called contains. It checks to see if one string is contained within the other. This seems like a good way to build a master list of words that are not allowed. Why don't you see if what they typed is in a long string of bad words.
    • After you get that working, attempt to take case into account. If your list of bad words that you maintain is all lower cased, you can check the lower case version of the input in the bad string. How do you make a string lowercase?
    • Watch the Feeling Loopy workshop

Related Courses

Reviews

Start your review of Java Basics Course

Never Stop Learning!

Get personalized course recommendations, track subjects and courses with reminders, and more.

Sign up for free