(You should complete Self-Check 8.26 before answering this question. Go back to that exercise and copy/paste your solution here as a starting point.) Add mutator methods called setFirstName,...


What I have done wrong with this code?


(You should complete Self-Check 8.26 before answering this question. Go back to that exercise and copy/paste your solution here as a<br>starting point.)<br>Add mutator methods called setFirstName, setMiddleInitial, and setLastName to your encapsulated version of the Name class<br>from the last exercise. Give the parameters the same names as your fields, and use the keyword this in your solution.<br>Type your solution here:<br>1 class Name{<br>9 constructor Name in class Name cannot be applied to given types;<br>2 public void setFirstName(String firstName) {<br>4 this.firstName<br>firstName;<br>5<br>6 }<br>7<br>8 public void setMiddleInitial (String middleInitial) {<br>9<br>10 this.middleInitial<br>middleInitial;<br>%D<br>11<br>12 }<br>13<br>14 public void setLastName (String lastName) {<br>15<br>16 this.lastName<br>lastName;<br>%3D<br>17<br>18 }<br>19<br>20 }<br>This is a class problem. Submit a complete Java class as described.<br>4<br>Indent<br>ý Submit<br>Sound F/X<br>O Highlighting<br>

Extracted text: (You should complete Self-Check 8.26 before answering this question. Go back to that exercise and copy/paste your solution here as a starting point.) Add mutator methods called setFirstName, setMiddleInitial, and setLastName to your encapsulated version of the Name class from the last exercise. Give the parameters the same names as your fields, and use the keyword this in your solution. Type your solution here: 1 class Name{ 9 constructor Name in class Name cannot be applied to given types; 2 public void setFirstName(String firstName) { 4 this.firstName firstName; 5 6 } 7 8 public void setMiddleInitial (String middleInitial) { 9 10 this.middleInitial middleInitial; %D 11 12 } 13 14 public void setLastName (String lastName) { 15 16 this.lastName lastName; %3D 17 18 } 19 20 } This is a class problem. Submit a complete Java class as described. 4 Indent ý Submit Sound F/X O Highlighting
This is a class problem. Submit a complete Java class as described.<br>4<br>Indent<br>* Submit<br>Sound F/X<br>V Highlighting<br>Your code did not compile. Please read and correct the errors below.<br>Error emitted from internal testing code. This error is occurring when our internal testing code is trying to call your code. If<br>you see this, it may mean that you have the wrong header for your solution, or a mismatched { } ) brace.<br>You are passing the wrong<br>pe/number of parameters when calling a method.<br>constructor Name in class Name cannot be applied to given types;<br>new Name(

Extracted text: This is a class problem. Submit a complete Java class as described. 4 Indent * Submit Sound F/X V Highlighting Your code did not compile. Please read and correct the errors below. Error emitted from internal testing code. This error is occurring when our internal testing code is trying to call your code. If you see this, it may mean that you have the wrong header for your solution, or a mismatched { } ) brace. You are passing the wrong pe/number of parameters when calling a method. constructor Name in class Name cannot be applied to given types; new Name("Default", 'D', Name name = "Default"); required: no arguments found: String, char, String reason: actual and formal argument lists differ in length
Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here