Created
July 14, 2019 11:06
-
-
Save harrisonmalone/7707f2608ad091df74b87d51f9e5b8f8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.*; | |
| public class CreateEmployee { | |
| public static void main(String[] args) { | |
| System.out.println("Enter a number:"); | |
| Scanner scanner = new Scanner(System.in); | |
| String userInput = scanner.nextLine(); | |
| System.out.println(userInput); | |
| // ArrayList<String> list = new ArrayList<String>(); | |
| // list.add("A"); | |
| // list.add("B"); | |
| // list.add("C"); | |
| // System.out.println(list); | |
| ArrayList<String> list = new ArrayList<String>(); | |
| String[] items = {"a", "b", "c", "d"}; | |
| for(int i = 0; i < items.length; i++){ | |
| list.add(items[i]); | |
| } | |
| System.out.println(list); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Employee { | |
| private String name; | |
| public Employee(String name) { | |
| this.name = name; | |
| } | |
| public String toString() { | |
| return "Name: '" + this.name + "'"; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment