Class B is inner class for A. Class B extends class C which is also inner class for A.
class A{
class C{
}
class B extends C{
}
}.
How do I cast an object of type C to type B from outside class A?
I was trying (A.B)objectOfC, but this does not work
Ok so the error I get is that java asks me to put “)” after “(A.”. When I do that it says “Illegal start of expression.
1 Answer