Quantcast
Channel: Confusion about constructors - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by SRy for Confusion about constructors

so your answer will be public SomeClass{ String str1; String str2; String str3;public SomeClass(String str1){ this.str1=str1; }; public SomeClass(String str1,String...

View Article



Answer by Richard Owczarzy for Confusion about constructors

I got similar questions in my previous Java course. You are writing constructor for SomeClass. You are supposed to overload the constructor, e.g. it can accept a different number of arguments...

View Article

Confusion about constructors

Consider the following segment of code.SomeClass someObject1 = new SomeClass("Computer Science");SomeClass someObject2 = new SomeClass("Computer Science", "Rocks");SomeClass someObject3 = new...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>