GameObject have no transform!

I have a class inherited to another class
And i can’t get the transform on the inherited class.
here’s what i have and trying to do

Class A:Monobehavior{}
Class B:A{}

//somewhere else
A object = new B();

but right now, whenever i try to get the transform of object, either from a function in B or out here via
object.transform,
It will always return null.

How do i fix this?

You cannot instantiate a MonoBehaviour (which class B is) with new. You should be getting a warning in the consone when doing this.

Create a new GameObject and use AddComponent instead:

GameObject newObject = new GameObject("MyObject");
A newA = (A)newObject.AddComponent<B>();