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
The Demons Command Each Other - Huben's Wiki

The Demons Command Each Other

From Huben's Wiki
Jump to: navigation, search
 
Line 1: Line 1:
 +
<!--
 +
    This needs to be extended to explain the idea of execution flow during a call, especially the idea of returning to where you were called.  Then the test can also be extended.
 +
    Have some code they can run, explaining how to step through a program in Dr. Java.
 +
-->
 +
[[Image:Gort.jpeg]]
 +
 
We have penetrated the mysteries of finding demon commands.  Now we must seek to use those commands, and thus control our demons.
 
We have penetrated the mysteries of finding demon commands.  Now we must seek to use those commands, and thus control our demons.
 
==(A) First Call==
 
==(A) First Call==
Line 38: Line 44:
 
public class Nietzsche
 
public class Nietzsche
 
{
 
{
   public void speak()
+
   static public void speak()
 
   {
 
   {
 
     System.out.println("Thus spake Zarathustra!");
 
     System.out.println("Thus spake Zarathustra!");
Line 60: Line 66:
 
* The third line of main() shows another way to invoke the speak() of DayTheEarthStoodStill.  Why does this work?
 
* The third line of main() shows another way to invoke the speak() of DayTheEarthStoodStill.  Why does this work?
 
* What rule would you make to explain why sometimes you can call with just the name of a method and other times you need something more complex?
 
* What rule would you make to explain why sometimes you can call with just the name of a method and other times you need something more complex?
 +
* If you are looking at Nietzsche and hit run, for once the error message makes sense.  Why does this give an error?
  
 
==(C) Method Calls In Real Programs==
 
==(C) Method Calls In Real Programs==
Line 105: Line 112:
 
* How many arguments does setBounds() have?
 
* How many arguments does setBounds() have?
 
* Do these 3 last method calls return any values?
 
* Do these 3 last method calls return any values?
 +
 +
==(D) Do you get it?==
 +
 +
Look at studentdisk/Ch07/Craps/RollingDie.java.
 +
* List the methods of class RollingDie.
 +
* How many arguments does each of those methods need?
 +
* Where are each of those methods called in class RollingDie (0 to many places.)
 +
* What is the name of the constructor method?  Is there a coincidence involved?
 +
* How many different methods of class Math are called?
  
 
All you need now are variables, objects, arguments and conditionals: then you shall understand most of the wiles of these demons in Java code.
 
All you need now are variables, objects, arguments and conditionals: then you shall understand most of the wiles of these demons in Java code.

Latest revision as of 13:23, 20 September 2013

Personal tools
translate