Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning VB.NET Databases

Authors: Thearon Willis

1st Edition

1594864217, 978-1594864216

More Books

Students also viewed these Databases questions