com.perisic.shadow.example.mains
Class Simple

java.lang.Object
  extended by com.perisic.shadow.example.mains.Simple

public class Simple
extends java.lang.Object

This example does not uses shadows. It serves as a starting point for the following examples. The course of action is as follows:

  1. Two objects (fabian, tomislav) are instantiated.
  2. Fabian smiles.
  3. Fabian tells Tomislav a joke making him smile.
Note that all methods are called via the call.(...) Syntax. Basically foo.bar(arg1, arg2, ...) is equivalent of foo.call("bar", arg1, arg2, ...). The latter form is neccessary to enable shadowing.
public class Simple{

 public static void main(String [] args) {
       NiceFellow fabian = new NiceFellow("Fabian");
       NiceChild tomislav = new NiceChild("Tomislav");

       fabian.call("smile",1);
       fabian.call("printMood"); 
       tomislav.call("printMood");

       System.out.println("");

       fabian.call("tellJokeTo", tomislav );
       tomislav.printMood();
       }

 }


Constructor Summary
Simple()
           
 
Method Summary
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Simple

public Simple()
Method Detail

main

public static void main(java.lang.String[] args)