I've seen many different answers to this...is it possible to have a constructor for a class that returns a value?

Recommended Answers

All 2 Replies

It does return a value, the reference to the class you just constructed. A constructor can return nothing else (or it's not a constructor).

commented: Well said. +14

Good point!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.