Play audio slide show -- Keyboard shortcut: 'x'  Back to slide -- Keyboard shortcut: 'u'        next  Play sound for this slide -- Keyboard shortcut: 'y'  MultidotDemo1.java - Et Java program som illustrerer multidotning i kombination med metode aktivering.Lecture 4 - slide 27 : 33
Program 1

public class MultidotDemo1{

  static C obj = new C(10);
  static C res;

  public static void main(String[] args){

    res = obj.anotherC(5).anotherC(6).anotherC(7);
    System.out.println(res);

  }

}


class C{

 int state;

 public C(int i){
   state = i;
 }

 public C anotherC(int i){
   return(new C(this.state + i));
 }

 public String toString(){
   return(Integer.toString(state));
 }

}