The usual way to share properties and behaviors (methods/operations) between classes is to use inheritance:
Class X { // Common base
int a;
int b;
}
Class A:X { // One specialization
int c;
}
Class B:X { // Another specialization
int d;
}
This facilitates reuse, since you may reuse the implementation of X in different contexts.
But using inheritance is not just about sharing some elements: inheritance also defines a genaralization/specialization relation: A is a special kind of X. This implies that one could hope that where an X is used, an A could be used as well. Moreover, this is a definitive relationship: an A is ALWAYS an X.
But as you pointed out, if it's just for sharing, and in absence of any conceptual relationship, it may not be the wisest idea to use inheritance to save a few keystrokes. In case of doubt you could prefer composition over inheritance:
Class X { // Some elements to be shared
int a;
int b;
}
Class A { // Independent class
X x;
int c;
}
Class B:X { // Another independent class
X x;
int d;
}
Each A and B would have a property x, that contains the shared a and b. The advantage is that A and B are not constraint to impelment X's interface. Furthermore the relation is dynamic (you could for example have no x defined, or the x can change). Furthermore, and depending on the language, you may even share the same x object between several A and B objects.