+ Start a Discussion

Creating an object from another class from within my VF Controller class

I have an easy question (I hope).


I've created a custom controller for a VF page and another (completely separate) class.  In my controller I want to use the separate class just to instantiate an instance of that kind of object.


How can I refer to the other class?  Is it necessary to specify the other class in the "extensions=" parameter of my VF page?


For example, I just want to have this, from my custom controller:

MyClass c = new MyClass();


I can't seem to get the controller to "recognize" MyClass unless it's an extension.

Best Answer chosen by Admin (Salesforce Developers) 

Well, nevermind.


I just tried it again without using the class in the "extensions" and I got it to work just by referencing the class name.