Skip to content

Commit

Permalink
chore(5.5.1): format & close scanner object
Browse files Browse the repository at this point in the history
  • Loading branch information
101zh committed Nov 15, 2023
1 parent 0f97068 commit 8a60ad8
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions src/test/java/Unit5/runner_Person.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@
// Have to get rid of package statement

import java.util.Scanner;
public class runner_Person
{

public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);

System.out.println("Enter the person's first name:");
String firstName = scan.nextLine();
System.out.println("Enter the person's last name:");
String lastName = scan.nextLine();
System.out.println("Enter the person's age:");
int age = scan.nextInt();
scan.nextLine();
System.out.println("Enter the person's social security number:");
String ssn = scan.nextLine();

System.out.println();
Person person = new Person(firstName, lastName, age, ssn);
System.out.println(person);
}

public class runner_Person {

public static void main(String[] args) {

Scanner scan = new Scanner(System.in);

System.out.println("Enter the person's first name:");
String firstName = scan.nextLine();
System.out.println("Enter the person's last name:");
String lastName = scan.nextLine();
System.out.println("Enter the person's age:");
int age = scan.nextInt();
scan.nextLine();
System.out.println("Enter the person's social security number:");
String ssn = scan.nextLine();

System.out.println();
Person person = new Person(firstName, lastName, age, ssn);
System.out.println(person);

scan.close();
}
}

0 comments on commit 8a60ad8

Please sign in to comment.