Java class extension
I'm a bit confused on what Java classes inherit with "extends". I have a class called "Shape", and multiple classes such as box, circle. The box, circle, etc. all have three variables in common. The Shape class is needed to hold a static var to count the number of classes. I also have a vector of Shapes in another class. If I declare a circle class will that correctly fit into a shape vector? I also notice I could do something like this: 

Shape shape = new Circle();  
ShapeVector.add(shape);  


I know there are interfaces but can they contain static vars as I need with count and will if the vector is made of an interface will it accept implemented classes?

I have tried with interface, abstract class, etc. but I think there are too many combinations to test and it would take much longer than to ask a question.
Java class extension
===

I'm a bit confused on what Java classes inherit with "extends". I have a class called "Shape", and multiple classes such as box, circle. The box, circle, etc. all have three variables in common. The Shape class is needed to hold a static var to count the number of classes. I also have a vector of Shapes in another class. If I declare a circle class will that correctly fit into a shape vector? I also notice I could do something like this: 

Shape shape = new Circle();  
ShapeVector.add(shape);  


I know there are interfaces but can they contain static vars as I need with count and will if the vector is made of an interface will it accept implemented classes?

I have tried with interface, abstract class, etc. but I think there are too many combinations to test and it would take much longer than to ask a question.