Students, please be sure to log in. This site does not use cookies and does not track/store work submitted when not signed in.
Unit 6 Problems
Java Reference Sheet
oneDouble
Objective(s): Practice declaring and instantiating arrays.
Declare and instantiate an array containing the singular value 3.14
Do you recall the second way to create and initialize an array? There is also a "one-liner" way to declare and initialize a very small array! I would not recommend it if the array is too long. The syntax is below.
//where val1, val2, etc are literal values match the type
type[] nameOfArray = {el1, el2,el3, ..., elN};