Pre and Post Conditions

Some examples:

public static double density (double    m, double v)
{ //Pre: v is not zero. m and v are positive
  //Post: returns the density for the given mass and volume   
return m/v; 
}
public static void pointless (int j)
{ //Pre: none (j should be positive to run the method
//Post: displays j stars on the screen
  while (j<0)
{ System.out.println(“*”);
j--;
}
}