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


Java Basics Course

via Treehouse


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


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


  • Review: Introduction to Your tools

    3 questions

  • Strings and Variables


  • Strings, Variables, and Formatting

    3 objectives

  • Receiving Input


  • 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


  • Multiple Format Strings

    3 objectives

  • Errors


  • Errors

    3 questions

  • Coding the Prototype


  • 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


  • Conditional ints

    3 objectives

  • Parsing Integers


  • Parsing Integers

    1 objective

  • Censoring Words - Using String Equality


  • String Equality

    2 objectives

  • Censoring Words - Using Logical ORs


  • Using Logical ORs and ANDs

    5 questions

  • Censoring Words - Looping Until the Value Passes


  • 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


Start your review of Java Basics Course

Never Stop Learning.

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