-
-
Save codecademydev/2e406fa349d3cb0d81702cf2cbdbab41 to your computer and use it in GitHub Desktop.
Codecademy export
This file contains 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.ArrayList; | |
public class Temperatures { | |
public static void main(String[] args) { | |
/*create arraylist object weeklyTemperatrues of class type Integer(whole number) | |
*/ | |
ArrayList<Integer> weeklyTemperatures = new ArrayList<Integer>(); | |
/*adding integers 78, 67, 89, 94 to the arraylist. calling method add on arraylist object weeklyTemperatures | |
*/ | |
weeklyTemperatures.add(78); | |
weeklyTemperatures.add(67); | |
weeklyTemperatures.add(89); | |
weeklyTemperatures.add(94); | |
//using get method to print lowest temp in weeklyTemperatrues | |
System.out.println(weeklyTemperatures.get(1)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment