top of page

package chapter5; import java.util.Scanner; /* * OUR FIRST METHOD * Write a method that asks a user for their name, then greets them by name. */ public class Greetings { public static void main(String args[]){ System.out.println("Enter your name:"); Scanner scanner = new Scanner(System.in); String name = scanner.next(); scanner.close(); greetUser(name); } public static void greetUser(String name){ System.out.println("Hi there, " + name); } }

Search

United States Code

United States Code Book The United States Code (U.S.C.) is a compilation of the permanent and general federal laws of the United States,...

Bill of Rights

The United States Bill of Rights is the first ten amendments to the Constitution, outlining Americans' rights in relation to their...

Thank you for subscribing please if you need help let me know by sending your information. This is a legal services website.

bottom of page