10 Replies Latest reply: Oct 13, 2009 8:39 PM by 807580 RSS

    Test Class and Object Creation

    807580
      Using this class, I have to create a test class that<BR><BR>1. Create 3 objects (I name one)<BR>2. Deploy pressure & tempature of each object<BR><BR>I have created the 1st part below but not sure how to do the test class and #1 and 2, could someone assist in this development, thanks:<BR><BR>public class Gas3 {<BR><BR>private double pressure;<BR>private double temperature;<BR><BR>// 1st constructor: initializes variables to default values <BR>public Gas3 ( ) {<BR>pressure = 101325.0;<BR>temperature = 273.0;<BR>}<BR><BR>// 2nd constructor: customizes variables with two arguments <BR>public Gas3 ( double p, double t ) {<BR>pressure = p;<BR>temperature = t;<BR>}<BR><BR>public double getPressure ( ) {<BR>return pressure;<BR>}<BR><BR>public double getTemperature ( ) {<BR>return temperature;<BR>}<BR>}