previous | start | next

Constructors

Does the IntPair class have a constructor?

    1   public class IntPair
    2   {
    3     private int x;
    4     private int y;
    5   
    6     public IntPair(int x, int y)
    7     {
    8        this.x = x;
    9        this.y = y;
   10     }
   11     
   12     public IntPair()
   13     {
   14       x = 0;
   15       y = 0;
   16     }
   17   
   18     public int x() {
   19       return x;
   20     }
   21    
   22     public int y() {
   23       return y;
   24     }
   25   }


previous | start | next