forked from Denisolt/CSCI-160
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWordList.java
More file actions
28 lines (26 loc) · 815 Bytes
/
WordList.java
File metadata and controls
28 lines (26 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//Denisolt Shakhbulatov
import java.util.ArrayList;
import java.util.Scanner;
public class WordList
{
public static void main(String [] args)
{
Scanner kb = new Scanner(System.in);
ArrayList<Integer>myList = new ArrayList<Integer>();
System.out.print("Enter the first number for the arraylist: ");
int num1 = kb.nextInt();
System.out.print("Enter the second number for the arraylist: ");
int num2 = kb.nextInt();
myList.add(num1);
myList.add(num2);
int highest = myList.get(0);
for (int index = 0; index < myList.size(); index++)
{
if(highest<myList.get(index))
{
highest = myList.get(index);
}
}
System.out.println(highest);
}
}