Both shape and circle are data types.
And so are Main and HelloWorld data types.
Type: Posts; User: Norm
Both shape and circle are data types.
And so are Main and HelloWorld data types.
What's the point?
Where is the method that takes an argument of type shape?
void SomeMethod(shape aShape) {
}
You could NOT pass an object of the circle class from your second code...
Interfaces are a way to give a data type to an object. Java is strict on data typing compared to c.
They allow the compiler to verify that a class object has the method(s) required for that data...