Questions Part 3: Use the following class to answer these questions about java c
ID: 3701890 • Letter: Q
Question
Questions Part 3: Use the following class to answer these questions about java classes public class Partnershipl private String terrible; private String dominant; private String national; public Partnership(String terrible, String dominant, String national)y this.terrible terrible; this.dominant dominant this.national national; @Override public String to String0 return this.terriblethis.dominant this.national; public static void main(String args Partnership instance new Partnership("acilitate", "alien", confess) System.out.printin/(instance): What is printed to the console when this class is ran as a java application? submit 1/3 questions for this part started Firefox in a while. Do you want to clean it up for a fresh, like-new experience? And by the way, welcome backt 2 CSE115: Computer SciExplanation / Answer
---------------------below line will be printed------------------------
facilitate alien confess
-----------------------end--------------------
the data members of Partnership class are in private so these cannot be acessed from the object instance we passed the values i.e strings for each data members through constructors and the values are assigned to the data mambers.
now we Overide the inbuilt function toString and this overriden function returns the string by concatinating all the member variables.
when we make instance object and printed the instance using println it prints the string which was returned by toString function.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.