Skip to content

Instantly share code, notes, and snippets.

@thacherhussain
Created February 9, 2017 18:02
Show Gist options
  • Save thacherhussain/4733cf3a986d552294d3e70018f239f5 to your computer and use it in GitHub Desktop.
Save thacherhussain/4733cf3a986d552294d3e70018f239f5 to your computer and use it in GitHub Desktop.

Java Lesson Plan

Create a lesson plan for a lesson on data types and variables in Java.

You can assume students have seen a “Hello World” application in Java with explanations of “static void main(String[] args)”, how to run a Java program, etc.

Also assume that students have already learned procedural and object-oriented basics in Python, so the lesson should compare/contrast to Python.

This doesn’t need to be a full written-out lesson, just an outline. Though please do include any code examples you would use.

Context: Basics of Java - Data Types and Variables

Objectives:

  • Define the Different Data Types
  • Dynamic v. Static Data Types
  • Types of Variables
  • Variable Declaration

Code Examples and Notes:

Let's remember where we started -- hello world example:

class Main {
  public static void main(String[] args) {
    System.out.println("hello world");
  }
}

Using the skeleton of our class Main let's print an integer, a boolean, and a char value:

class Main {
  public static void main(String[] args) {
	System.out.println(7);
  System.out.println(true);
  System.out.println('A');
}

Using the same structure we can define int boolean and char variables:

class Main {
  public static void main(String[] args) {
    int favoriteNumber = 3;
		boolean justTheTruth = true;
		char myScienceGrade = 'B';
}

Sources:

https://www.sitepoint.com/beginning-java-data-types-variables-and-arrays/

https://www.cs.utexas.edu/~scottm/cs307/codingSamples.htm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment