Java Differences (Module 2)
Java Differences (Module 2)
Methods Constructors
It can have any name It should have the same name as that of the class name
It will allow modifiers Modifiers are not allowed
Return type is mandatory Return type is not allowed
It will execute when called by the user It will execute automatically when we create object
It is used to write business logics It is used to initialize the non-static variables