Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 860

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 860

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 834

Warning: Invalid argument supplied for foreach() in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 835

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 839

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 834

Warning: Invalid argument supplied for foreach() in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 835

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 839

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 860

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 860

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 834

Warning: Invalid argument supplied for foreach() in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 835

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 839

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 834

Warning: Invalid argument supplied for foreach() in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 835

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 839

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 860

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 834

Warning: Invalid argument supplied for foreach() in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 835

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 839

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 834

Warning: Invalid argument supplied for foreach() in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 835

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 839

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 860

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 860

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 860

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 860

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 860
Fear Not Demon Curses - Huben's Wiki

Fear Not Demon Curses

From Huben's Wiki
Jump to: navigation, search
 
Line 1: Line 1:
 +
[[Image:DemonCurse.jpeg]]
 +
 
If we make even the tiniest mistake during our incantations, our demons will hurl dire curses at us, called '''error messages'''.
 
If we make even the tiniest mistake during our incantations, our demons will hurl dire curses at us, called '''error messages'''.
  
 +
==(A) First Incantations==
 
Consider this simplest of demons:
 
Consider this simplest of demons:
 
<pre>
 
<pre>
Line 17: Line 20:
 
* Compile it and then run it.
 
* Compile it and then run it.
 
* Where does the result appear?
 
* Where does the result appear?
 +
* What is the result and how could you change it?  Change it!
 +
* The line with the System.out.println incantation ends with a semicolon. What does that make the line?
 +
* Add still more System.out.println incantations!  What happens?
 +
 +
This demon invocation contains two major incantations.  An incantation is magical lore that you need not understand, yet when repeated will still command our demons.  The first incantation, '''static public void main(String[] args)''', is how we create a class of demons called '''console applications'''.  The second incantation, '''System.out.println("Hello world!");''' is a statement that commands demons to print something to the console.  The console is the bottom pane of Dr. Java, or in the Windows '''Command Prompt''' application.  The muggle textbook tells how to do the latter in chapter 2.4.
  
Now comes the wierdness!
+
==(B) Now comes the wierdness!==
  
 
* Remove one of the curly braces, save,compile and run.
 
* Remove one of the curly braces, save,compile and run.
Line 28: Line 36:
 
* They are always true, but are they ever helpful?
 
* They are always true, but are they ever helpful?
  
Here is your trial by fire!
+
==(C) Trial by fire!==
  
 
* Restore the unindented version of HelloGraphics from the previous class.
 
* Restore the unindented version of HelloGraphics from the previous class.
Line 34: Line 42:
 
* Everybody take turns!
 
* Everybody take turns!
  
Improperly matched braces are the most common and confusing errors.  Knowing this, you can repair many incantations with confidence, even if you are unsure of their meaning.
+
Improperly matched braces are the most common and confusing errors.  Knowing this, you can repair many demon summonings with confidence, even if you are unsure of their meaning.

Latest revision as of 13:01, 16 September 2013

Personal tools
translate