Friday, June 3, 2011

June 3st - 2011

public class sailboat extendets watercraft
{



public stringtostring(){
string assembply;
final double poundspertonne= 2204/62262;
double pounds = getDisplacement()*poundsPerTonne;
assembly += "masks, displacement";
assembly += Double.toString(pound);
assembly += " pounds." ;
return (assembly);



Question 12:52 PM
Sailboar laser2 = new Sailboat();
laser2.toString();



choice of overload is made at compile time based on signaure of the method
choice of override is made at runtime based on type of object

No comments:

Post a Comment