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

Please help me
Please help me Consider the code set below. 3 public class Ex1_RunSetGet

Consider the code set below. 3 public class Ex1_RunSetGet i 4 public static void main(String[] args) { 5 6 SetGet sg = new SetGet("Samuel"); 7 8 System.out.println(sg.getName()); 9 1 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 namen 22 3 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"); O sg.setName("Prva 0 0 5g.setName(String "Priya) setNomePriya"); setNameString "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!