Question: public class Utils { / * - - - - - - - - - - - - - - - - - - -

public class Utils {
/*----------------------------------------------
* Modify the method below.
*
* The method below, myMethod, will be called from a testing function in VPL.
*
* Write one line of Java code inside the method that adds one String
* to another. It will look something like this:
*
* Assume that
*1. String theInput is George
*.2. String myString is Hello, my name is
*
* We want to update myString so that it is
* Hello, my name is George
*
*----------------------------------------------*/
public static String myMethod(String theInput){
System.out.println("This method combines two strings.");
String myString = "Hello, my name is ";
// Update the "myString" object.
// Do this by "adding" myString and theInput together.
// How do you add two Strings together? Use the "plus" sign, like this:
// firstString = firstString + secondString
myString = myString + theInput; //<------- update this!!!!!!!
System.out.println("we combined two strings to make "+ myString);
return myString;
}
}

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!