Question: line 17 not 7 please!! Consider the code set below. 3 public class Ex1_RunSetGet { 4- public static void main(String[] args) { 5 6 SetGet

 line 17 not 7 please!! Consider the code set below. 3
line 17 not 7 please!!

Consider the code set below. 3 public class Ex1_RunSetGet { 4- public static void main(String[] args) { 5 6 SetGet sg = new SetGet("Samuel"); 8 System.out.println(sg.getName()); } 10 ) 11 12 class SetGet { 13 14 private String name = "Kevin"; 15 16- SetGet(String name) { 17 18 } 19 20 public void setName(String n) { 21 name n; 22 } 23 24 25 26 27 ) What is the correct statement to be inserted in line 7 to change the value of the variable name on object sg to "Priya O sg.setName("Kevin", "Priya"); Sa O setName("Priya"); sg.setName(String "Priya"); sg.setName("Priya"); setName(String "Priya")

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!