Regarding syntax for object creation using new
keyword. I know that syntax to create an object is:
Foo ref = new Foo();
Do java language in itself provide some mechanism that can create object other than standard syntax as mentioned above?
I have knowledge that Scala has such functionality or may be some other JVM compatiable language but I want to know from just core java point of view.
Without using keyword 'new' and assignment operatior '='. For example it can be like Foo ref Create(). ? Now I want to develop 'Create' method to replace traditional syntax.
Another way you can create an object is by reflection: