



|
|
CS1 Course Site
|
Wait , WAIT !!What's that word ? ( Class Notes ( without definitions ) )
Monday November 27 , 2000
|
|
Superficial Signatures
int x = 5;
double y = 3.5;
double p = x * y;
IO.println ( ``the product is'' + p);
The superficial signature is...
int x = < int >
double y = < double >
double p = < int > * < double >
IO.println (< string? + < double >);
Ex
Circle c = new Circle (10);
Square s = new Square (10.0);
double aa = (c.area () + s.area ()) / 2.0;
The Superficial Signature is...
Circle c = new Circle (< int >);
Square s = new Square (< double >);
double aa = (< circle > .area () + < square > .area ()) / < double >;
Instantiat the instance variable - constructors.
Dictionary d = new Dictionary ( ``Animals'');
String [] s = new string [2];
s [0] = ``ard'';
s [1] = ``vark'';
Word a = new Word ( ``ardvark'', s);
d.add (a);
|
|