Parameter:

Text Box: The method, println has an explicit parameter, greeting which is "Hello World".
The  method, println has an implicit parameter, System.out.
There is no return value for the println method.
String greeting = "Hello, World";  //declare & define a variable

The object, System.out, is an implicit parameter for println().


Return value:   greeting.length();

You can either store the return value in a variable or print the return value on screen.

int n = greeting.length();

System.out.println(greeting.length());


The replace method has two parameters:  the function header is below.

public String replace (String target, String replacement)

for example,     System.out.println(greeting.replace("World", "Valerie"));

What is the result of the call greeting.replace("World", "Valerie")?

public class Mytest
{
	public static void main (String [] args)
	{
		String greeting = "Hello, World";  
		System.out.println("The content of greeting is " + greeting);
		System.out.println("The number of characters = " + greeting.length());
		System.out.println("The return value after calling replace method: " + 
                                     greeting.replace("World", "Valerie"));
		System.out.println("The content of greeting is " + greeting);
	}
}

How about greeting.replace("World", "Valerie").length()?

As public String toUpperCase(), with no explicit parameter and return type String.

public class Mytest
{
	public static void main (String [] args)
	{
		String greeting = "Hello, World";  
		System.out.println("The content of greeting is " + greeting);
		System.out.println("The number of characters = " + greeting.length());
		System.out.println("The return value after calling replace method: " + 
                                     greeting.replace("World", "Valerie"));
		System.out.println("The content of greeting is " + greeting);
                System.out.println(greeting.toUpperCase());
		System.out.println("The content of greeting is " + greeting);
	}
}

What is the output of  System.out.println(greeting.replace("World", "Valerie").toUpperCase());