In this statement, C
is clearly has an "isA" relationship with B
- i.e., B
is either C
's ancestor or an interface that C
implements.
In other words, you have one of
class B { ... }
class C extends B [ ... }
or
interface B { ... }
class C implements B { ... }
where there could also be combinations of these and B
and C
could be more than one inheritance step apart, for instance
class B { ... }
class X extends B { ... }
class C extends X { ... }
You're creating a C
instance and assigning it to a variable of type B
, meaning you'll only be able to use methods visible via B
(without explicit casting, at least).