If this is a class that you want to copy very often ... this is possibly the functionality and behavior that you want in the copied classes. This is very easy to do using inheritance.
So, create a class that has common functionality as a superclass and let all classes that need these functions extend it. All this.
Copying and pasting is not a good idea .. because you will distribute the same logic in several files, which will hurt if you want to change any behavior - you will have to edit all the copied files. Inheritance will keep them in one place.
source share