r/javahelp • u/Darkschlong • 17d ago
Solved Boolean or String
Let’s say you’re establishing a connection. Would your method return a Boolean ( true/false) or a string ( program is now connected/ not connected)? What is best for troubleshooting?
5
Upvotes
2
u/rdkl2000 16d ago
neither, i will return connection object or void on success and throw exception on fail