title: Graph can not be resolved to a type eclipse error
body: <p>I'm having a problem with eclipse where it says graph can not be resolved to a type, its really confusing. Its part of a college program i wrote with the help of a text book.The problem seems to be everywhere i have DistPar, sPath and vertex list. Can anyone help. </p>
  
  <pre><code>public class shortpa {
  
      public int distance;
      public int parentVert;
      public char label;
      public boolean isInTree;
      public final int MAX_VERTS=20;
      public final int INFINITY=1000000;
      public Vertex vertexList[];
      public int adjMat[][];
      public int nVerts;
      public int nTree;
      public DistPar sPath[];
      public int currentVert;
      public int startToCurrent;
  
  
      public static void main(String[] args)
      {
          Graph theGraph = new Graph();//error here saying graph can nt be resolved to a type
          theGraph.addVertex('A');
          theGraph.addVertex('B');
          theGraph.addVertex('C');
          theGraph.addVertex('D');
          theGraph.addVertex('Z');
  
  
          theGraph.addEdge(1, 2, 10);//1 repesents A, 2 repesents B....etc and 10 is the weight
          theGraph.addEdge(1, 5, 18);
          theGraph.addEdge(2, 3, 3);
          theGraph.addEdge(2, 5,17);
          theGraph.addEdge(2, 4, 1);
          theGraph.addEdge(3, 4, 1);
          theGraph.addEdge(4, 5, 4);
  
          System.out.println("Shortest paths");
          theGraph.path();
          System.out.println();
  
      }
  //--------------------------------------------------------------------------    
      public void DistPar(int pv, int d)
      {
          distance = d;
          parentVert=pv;
      }
  //--------------------------------------------------------------------------    
      public void Vertex(char lab)
      {
          label = lab;
          isInTree = false;
      }
  //--------------------------------------------------------------------------    
      public void Graph()
      {
          vertexList = new Vertex[MAX_VERTS];/////error here saying vertex can not be resolved to a type
          adjMat = new int[MAX_VERTS][MAX_VERTS];
          nVerts=0;
          nTree=0;
          for(int j =0; j&lt;MAX_VERTS; j++)
              for(int k=0; k&lt;MAX_VERTS; k++)
              adjMat[j][k] = INFINITY;
          sPath = new DistPar[MAX_VERTS];//error here saying distpar can not be resolved to a type
      }
  //--------------------------------------------------------------------------
      public void addVertex(char lab)
      {
          vertexList[nVerts++] = new Vertex(lab);
      }
  //-------------------------------------------------------------------------
      public void addEdge(int start, int end, int weight)////have a look here
      {
          adjMat[start][end]=weight;
      }
  //--------------------------------------------------------------------
      public void path()
      {
          int startTree = 0;
          vertexList[startTree].isInTree = true;
          nTree = 1;
  
          for(int j=0; j&lt;nVerts; j++)
          {
              int tempDist = adjMat[startTree][j];
              sPath[j] = new DistPar(startTree, tempDist);
          }
          while(nTree &lt; nVerts)
          {
              int indexMin = getMin();
              int minDist = sPath[indexMin].distance;
  
              if(minDist == INFINITY)
              {
                  System.out.println("Unreachable vertexs");
                  break;
              }
              else
              {
                  currentVert=indexMin;
                  startToCurrent=sPath[indexMin].distance;
              }
              vertexList[currentVert].isInTree = true;
              nTree++;
              adjust_sPath();
          }
          displayPaths();
          nTree = 0;
          for(int j=0; j&lt;nVerts; j++)
              vertexList[j].isInTree = false;
      }
  //---------------------------------------------------------------------------   
      public int getMin()
      {
          int minDist = INFINITY;
          int indexMin = 0;
          for(int j=1; j&lt;nVerts;j++)
          {
              if(!vertexList[j].isInTree &amp;&amp; sPath[j].distance &lt; minDist)
              {
                  minDist = sPath[j].distance;
                  indexMin = j;
              }
          }
          return indexMin;
      }
  //------------------------------------------------------------------------------
      public void adjust_sPath()
      {
          int column = 1;
          while(column &lt; nVerts)
          {
              if(vertexList[column].isInTree)
              {
                  column++;
                  continue;
              }
              int currentToFringe = adjMat[currentVert][column];
              int startToFringe = startToCurrent + currentToFringe;
              int sPathDist = sPath[column].distance;
              if(startToFringe &lt; sPathDist)
              {
                  sPath[column].parentVert = currentVert;
                  sPath[column].distance = startToFringe;
              }
              column++;
          }
      }
  //------------------------------------------------------------------------------
      public void displayPaths()
      {
          for(int j=0; j&lt; nVerts; j++)
          {
              System.out.println(vertexList[j].label+"=");
              if(sPath[j].distance == INFINITY)
                  System.out.println("inf");
              else
                  System.out.println(sPath[j].distance);
              char parent = vertexList[sPath[j].parentVert].label;
              System.out.println(" (" + parent + ") ");
          }
          System.out.println("");
      }
  
  
  }
  </code></pre>