Hi,
You had a few things wrong here but you were not too far off. First of all, printf is fine because System.out is a type of printstream. Your main problems were related to scope of your variables and accessing the right variable names.
CODE
public class Product
{
// These variables belong to the class Product.
public int number; // number in inventory
public String title; // name of game in inventory
public int stock; // number of units in stock
public double price; // price of unit in inventory
// constructor for Product class
public Product(int idNumber, String gameTitle, int unitStock, double unitPrice)
{
// Here we use the passed parameters to set Product's variables
// Notice how I don't put datatypes on them, I am referencing the ones above with the bigger scope.
number = idNumber;
title = gameTitle;
stock = unitStock;
price = unitPrice;
} // end of constructor
// create objects for inventory
public static void main( String args[] )
{
// create object for first item
Product myProduct1 = new Product( 01, " Madden ", 3, 39.99);
myProduct1.displayInventory();
Product myProduct2 = new Product( 02, " Tiger Woods ", 3, 49.99 );
myProduct2.displayInventory();
Product myProduct3 = new Product( 03, " Grand Theft Auto ", 1, 39.99 );
myProduct3.displayInventory();
Product myProduct4 = new Product( 04, " Destroy All Humans ", 1, 24.99 );
myProduct4.displayInventory();
Product myProduct5 = new Product( 05, " Mafia ", 1, 29.99 );
myProduct5.displayInventory();
} // end main
// method for value anddisplaying members of inventory
public void displayInventory()
{
// Notice here that I am accessing the Product's variables, not the ones passed to product.
// They were only used to set the products variables which should then be referenced from now on.
System.out.print( number + "\t" + title + "\t" + stock + "\t\t" );
System.out.printf("$%.2f\t\t", price);
} // end display
} // end class Product
The main changes to this code are in Product's constructor as well as the displayInventory() method. Remember that the variable names you gave for the incoming variables are only used to set the product's member variables. All your methods should then access the Product member variable names because they are of higher scope and related to the Product.
This code above has been tested and compiles, the output could use some better organizing, but it is putting out what you designed it to do.
Look at the other member's examples on this board. Right now there are about 3 - 4 other people doing this same project.
Good luck.