public class Person { String name; public Person(String personName) { name = personName; } public String greet(String yourName) { return String.format("Hi %s, my name is %s", name, yourName); } }
name
yourName
String.format
public String greet() { return String.format("Hello %s!", name);}
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)