Wednesday, August 31, 2011

What are you implying?

Today we reviewed the class diagrams assignment from Monday.  Everyone did an excellent job and continues to show improvement.

We also starting our review of typecasting, also known as datatype conversions.  We went over the two different methods of datatype conversions:

Implicit casting
double quotient1 = 7 / 2;

Explicit casting
double quotient2 = (double) 7 / 2;
int quotient3 = (int)(9.99 / 1.11);


Homework: Explain why, in the examples given above, quotient2 returns 3.5, but quotient3 returns 9.

1 comment:

  1. should we just say the answer or you need a proof or s.thing? in other words can I ask someone else like a friend?!!! :D

    ReplyDelete