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_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
Commanding The Demons - Huben's Wiki

Commanding The Demons

From Huben's Wiki
Jump to: navigation, search
(Created page with "Today we will study the basic principles by which we command demons, and make them dance to our whims! ==The Anatomy Of Demon Commands== Consider this, our SimpleDemon from befo...")
 
Line 1: Line 1:
 
Today we will study the basic principles by which we command demons, and make them dance to our whims!
 
Today we will study the basic principles by which we command demons, and make them dance to our whims!
  
==The Anatomy Of Demon Commands==
+
==(A) The Anatomy Of Demon Commands==
 
Consider this, our SimpleDemon from before.
 
Consider this, our SimpleDemon from before.
  
 
<pre>
 
<pre>
 
1  public class SimpleDemon                          // class name
 
1  public class SimpleDemon                          // class name
2  {                                                                 // start of class body
+
2  {                                                 // start of class body
 
3
 
3
4    static public void main(String[] args)         // method signature
+
4    static public void main(String[] args)         // method signature
5    {                                                               // start of method body
+
5    {                                               // start of method body
6      System.out.println("Hello world!");         // statement in method body
+
6      System.out.println("Hello world!");           // statement in method body
7    }                                                               // end of method body
+
7    }                                               // end of method body
 
8
 
8
9  }                                                                 // end of class body
+
9  }                                                 // end of class body
 
</pre>
 
</pre>
  
Line 28: Line 28:
 
** Method bodies contain statements and perhaps more blocks.  We will not concern ourselves with these now, except to use the ' System.out.println' incantations.
 
** Method bodies contain statements and perhaps more blocks.  We will not concern ourselves with these now, except to use the ' System.out.println' incantations.
  
==Discovering The Commands Of Other Demons==
+
==(B) Discovering The Commands Of Other Demons==
 
Refer once again to [[Hogwarts School Of Computer Science|The Mystery Of The Curly Braces]].
 
Refer once again to [[Hogwarts School Of Computer Science|The Mystery Of The Curly Braces]].
 
* What is the name of the class of this demon?
 
* What is the name of the class of this demon?
Line 35: Line 35:
 
* Gaze upon the names of the class and the methods: are there differences in the first letters?
 
* Gaze upon the names of the class and the methods: are there differences in the first letters?
  
==A Profusion Of Demons==
+
==(C) A Profusion Of Demons==
 
* Download ye the dread [http://www.skylit.com/javamethods-old/studentdisk.zip Student Disk], and install it upon your H drive.
 
* Download ye the dread [http://www.skylit.com/javamethods-old/studentdisk.zip Student Disk], and install it upon your H drive.
 
* Explore the myriad demons which reside therein, and examine their commands (methods.)  Can you delve into their mysteries?
 
* Explore the myriad demons which reside therein, and examine their commands (methods.)  Can you delve into their mysteries?
 
* Peer into studentdisk/Ch11/Exercises/Triangle.java, and seek ye the five methods therein.  One of them is different: it bears the same name as the class and thus has yet another difference from all the other methods?  Know thou this difference?  
 
* Peer into studentdisk/Ch11/Exercises/Triangle.java, and seek ye the five methods therein.  One of them is different: it bears the same name as the class and thus has yet another difference from all the other methods?  Know thou this difference?  
 
* We call such methods '''constructors''': they are special, and we will learn of them later.
 
* We call such methods '''constructors''': they are special, and we will learn of them later.

Revision as of 10:06, 13 September 2012

Personal tools
translate