Monday, 15 April 2019

how to initialize the constructor?

A constructor is a function which is always present in a Java class. A new instance is always created to call the constructor in a valid state. In a ColdFusion framework, a constructor is always created and called automatically.    
To call a constructor, an object is created in CFML by <cfobject> tag. In ColdFusion framework, there is no need to create a new instance for calling the constructor. A new instance is automatically created to call the constructor methods and functions.   
In Java programming language, more than one constructor can be used. In an instance, one constructor might not take any values but a constructor might allow the instance to accept some values by default. In a class, many constructors can be initialized and used.
If a constructor is not available as default constructor, then init() method is used to work as a default constructor. This method helps in initializing the new instances. If a class is already using the init () method, it can not be called upon in ColdFusion 9 framework.
In a constructor, many arguments can be initialized. Their number has to be specialized in the init () method. It specifies the number of hyphen and space characters of the arguments in the init () method. After initializing properly, one object can be easily used to ghet its desired behaviour.  

Hope you have liked this post ! Thanks for reading it !
reference links -
https://mukeshtiwari.doodlekit.com/blog/entry/4884904/what-is-the-role-of-the-constructor-in-coldfusion-framework

No comments:

Post a Comment