Top Topics in our Forum';
Interactive Parabola Grapher
Explore graph ,equation and the locus of a Parabola
Save graphs to your desktop!

A+    A−    B  
Algebra
Games
Geometry
Interactive
Trigonometry
Forum



Warning: include(/home/mathwa6/public_html/php_include/forum_left_side.php) [function.include]: failed to open stream: No such file or directory in /home/mathwa6/public_html/php_include/ontheLeft_moris.php on line 296

Warning: include() [function.include]: Failed opening '/home/mathwa6/public_html/php_include/forum_left_side.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/mathwa6/public_html/php_include/ontheLeft_moris.php on line 296


AddThis Social Bookmark Button

Java Casting

How to and When to Cast Objects

"Read R to L"
ie Is "what is on the right" always "what is on the left" ?
Example 1) 
String str ="word";
Comparable p = str;//OK String is a Comparable 
"a String(str) is a Comparable"
Remember Strings implements the Comparable interface

Bad String str="words" Comparable p ="str; String t = p; //BAD becuase NOT all Comparables are Strings

Ok if you (cast) String str="words" Comparable p ="str; String t = (String)p ; // OK becuase NOT all Comparables are Strings
C1 implements i1 and i2 C c1 = i1 ;;yes