Is it possible to return int/string using constructor in Java? - Quora
Jan 19, 2017 ... This is a public static method whose sole purpose is to create an instance, and then return some value whose type can be anything you want.
Jan 19, 2017 ... This is a public static method whose sole purpose is to create an instance, and then return some value whose type can be anything you want.
The site owner hides the web page description.
Quora is a place to gain and share knowledge. It's a platform to ask questions and connect with people who contribute unique insights and quality answers. This empowers people to learn from each other and to better understand the world.
Mar 30, 2018 ... In most Object Oriented Programming languages, including Java, constructors cannot return a value because there would be no way to get at ...
Jan 20, 2019 ... You can't return ANYTHING from a constructor in either C++ or Java - or PHP or javascript or typescript or Go. There's no return type even - ...
May 3, 2018 ... Constructor is a block of code similar to method with no return type not even void. It is usually used to initialize the object of the class ...
May 26, 2017 ... The others who've answered are more experienced than myself, but I'll try to answer the question. Java has two types of variables and ...
Jun 24, 2018 ... The syntax of creating an array in Java using new keyword − [code]type ... How do I return a string array in Java? How do I check if an ...