answersLogoWhite

0

NO...The reason being, when you return something, someone is supposed to receive what you are returning...So when the object is not yet created, there wont be any body to receive it.

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

What is a constructor with value zero?

Constructors have no value, zero or otherwise. That is, constructors cannot return a value. This is because constructors are not functions in the sense you cannot call a constructor directly. Constructors are invoked in the background when you instantiate an object of the class, thus any return value would be lost in the background, and would therefore not be visible to the invokee.


What are the similarities between constructors and methods?

Two key points to remember about constructors are that they have no return type and their names must exactly match the class name. Methods can have any names and can have any return types.


How can you identify a constructor from among any other methods in a class?

Constructors have the same identifier as that of the class, so if the name of your class is Book then your constructor must also be named Book. Constructors have no return type, not even void.


What is main advantage of using constructors in java?

Constructors have the same name as the class itself and they do not specify a return type, not even void because they return the instance of the class itself. Because constructors have the same name as the class then they allow method overloading and also save memory and execution time of program. Program release memory of constructors function after using this function and it reduce program complexity.


What is different between constructor and method?

Constructors have no return type and their names must exactly match the class name. Apart from this constructors and methods are similar to one another.


How does return statement work in vb?

No Return statement in VB programming


What is return in programming?

The return statement is used in functions to return control to the caller. If the function is declared non-void, the return statement also allows the programmer to return a value to the caller.


What statement returns a value from a function?

return


How do you use return function?

return;orreturn ;PS: not function, statement!


What is return statement under function in turbo C?

return 0


Why the continue statement not allowed in swicth statements?

'continue' is allowed anywhere in a loop's body. But, sure, it is not synonym of 'break', which is a different statement.


A musical statement followed by a contrasting statement and then a return of the original statement would be called?

it is ternary form