RSS
Follow Us
Contribute
 
 
 
 

SomeClass cannot be resolved to a type

 
We need YOUR SKILLS in this collaborative work, to build the largest solution center for error messages.

From $1

Description

This is one of the most common error messages in java and it has got so many causes. It is genereated during compile time and it means that java cannot find the class that is defined in the error.

Cause: Importing the class is forgotten

The most common cause of this error message is defining a class within java APIs and not including it with the import keyword. Ex:

package SomePackage;

public Class SomeClass {
	Vector vector;
}

This code will generate Vector cannot be resolved to a type error.

Solution

Importing the Vector class will simply solve the problem.

package SomePackage;
import java.util.Vector;

public Class SomeClass {
	Vector vector;
}
 
 
 
 
Comments