// Test program which shows variable assignment. // After an assignment is made to a variable the results are printed out // This example was made for lecture 1 of ECE122 - Spring 2006 /* I can also use this format for comments * * I generally include many comments so I * * can figure out what is going on later */ public class StatementExample { public static void main(String[] args) { int age; // This is the name of a "variable" int weight; // This is another variable age = 5; // Set the age of the dog to 5. weight = 10; // Set the weight of the dog to 10 pounds // Print out information System.out.println ("My dog is " + age + " years old."); System.out.println("My dog weighs " + weight + " pounds."); System.out.println(age+ " " +weight); } }