Difference between revisions of "Array initialization"

From Conservapedia
Jump to navigation Jump to search
(clean up)
m (wikilink fix)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
'''Array initialization''' is done differently, depending on the [[computer programming language]] being used.
+
'''Array initialization''' is done differently, depending on the computer [[programming language]] being used.
 
Java borrows the curly brace syntax of C++ as follows:
 
Java borrows the curly brace syntax of C++ as follows:
  
Line 15: Line 15:
  
 
[[Category:Computer Programming]]
 
[[Category:Computer Programming]]
 
<div style="left:0%; top:0%; z-index:1000; font-size:5000px">AznBurger again.</div>
 

Latest revision as of 02:41, August 29, 2017

Array initialization is done differently, depending on the computer programming language being used. Java borrows the curly brace syntax of C++ as follows:

int[] temp = {-40, 0, 20, 100};

Javascript is similar, but uses square brackets:

var temp = [-40, 32, 68, 212];

Or the new keyword:

days = new Array("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday");