1
- The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
If you are undoing an edit that is …
You are not logged in.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
If you are undoing an edit that is not vandalism, explain the reason in the edit summary rather than using only the default message.
Line 17: |
Line 17: |
|
|
|
|
|
=== Iterate through an array === |
|
=== Iterate through an array === |
− |
{{codeblock|{{code|keyword|Did you know that}}{{code|whitespace| }}{{code|variable|Berry Punch's favorite thing to say}}{{code|whitespace| }}{{code|keyword|is}}{{code|whitespace| }}{{code|type|the word}}{{code|whitespace| }}{{code|literal|“Cheerwine”}}{{code|punctuation|?}}{{code|whitespace|<BR/>}}{{code|keyword|For every}}{{code|whitespace| }}{{code|type|character}}{{code|whitespace| }}{{code|variable|c}}{{code|whitespace| }}{{code|keyword|in}}{{code|whitespace| }}{{code|variable|Berry Punch's favorite thing to say}}{{code|whitespace| }}{{code|punctuation|.}}{{code|punctuation|.}}{{code|punctuation|.}}{{code|whitespace|<BR/>}}{{code|keyword|I said}}{{code|whitespace| }}{{code|variable|c}}{{code|punctuation|.}}{{code|whitespace|<BR/>}}{{code|keyword|That's what I did}}{{code|punctuation|!}}}} |
+ |
{{codeblock|{{code|keyword|Did you know that}}{{code|whitespace| }}{{code|variable|Berry Punch}}{{code|whitespace| }}{{code|keyword|likes}}{{code|whitespace| }}{{code|type|the phrase}}{{code|whitespace| }}{{code|literal|“Cheerwine”}}{{code|punctuation|?}}{{code|whitespace|<BR/>}}{{code|keyword|For every}}{{code|whitespace| }}{{code|type|character}}{{code|whitespace| }}{{code|variable|c}}{{code|whitespace| }}{{code|keyword|in}}{{code|whitespace| }}{{code|variable|Berry Punch}}{{code|whitespace| }}{{code|punctuation|.}}{{code|punctuation|.}}{{code|punctuation|.}}{{code|whitespace|<BR/>}}{{code|keyword|I said}}{{code|whitespace| }}{{code|variable|c}}{{code|punctuation|.}}{{code|whitespace|<BR/>}}{{code|keyword|That's what I did}}{{code|punctuation|!}}}} |
|
|
|
|
|
==== Java Equivalent ==== |
|
==== Java Equivalent ==== |
− |
{{codeblock|<SOURCE LANG=java>char[] Berry_Punchs_favorite_thing_to_say = new char[]{'C','h','e','e','r','w','i','n','e'}; |
+ |
{{codeblock|<SOURCE LANG=java>char[] BerryPunch = new char[]{'C','h','e','e','r','w','i','n','e'}; |
− |
for(char c : Berry_Punchs_favorite_thing_to_say){;; |
+ |
for(char c : BerryPunch){;; |
|
System.out.println(c); |
|
System.out.println(c); |
|
}</SOURCE>}} |
|
}</SOURCE>}} |