Question: please help me quick Consider the code set below. 3 public class Ex1_RunSetGet { public static void main(String[] args) { 5 6 SetGet sg =

please help me quick
please help me quick Consider the code set below. 3 public class

Consider the code set below. 3 public class Ex1_RunSetGet { public static void main(String[] args) { 5 6 SetGet sg = new SetGet("Samuel"); 7 8 System.out.println(sg.getName(); 9 } 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? Osg.setName("Kevin","Priya"); Osg.setName("Priya"); O sg.setName(String "Priya"); 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!