Play audio slide show -- Keyboard shortcut: 'x'  Back to notes -- Keyboard shortcut: 'u'              Play sound for this slide -- Keyboard shortcut: 'y'  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));
 }

}