Skip to content

Instantly share code, notes, and snippets.

@madevelopers
Created June 26, 2015 02:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save madevelopers/5244ba5b27086c43b942 to your computer and use it in GitHub Desktop.
Save madevelopers/5244ba5b27086c43b942 to your computer and use it in GitHub Desktop.
How to create a method that returns something in Java #java #flashcard

Declare the return type of the method. In this case we'll return the combined name which is a String.

public static String combineName(String firstName, String lastName) {
  return firstName + " " + lastName;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment