Follow Us
Contribute
  • Register

SomeClass cannot be resolved to a type

0 votes
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. requested 1 year ago by errorbase (169,970 points)
edited 1 year ago by onur

1 Solution

0 votes

Importing the Vector class will simply solve the problem.
 package SomePackage;

 import java.util.Vector;

 public Class SomeClass {

     Vector vector;

 }

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.

solved 1 year ago by errorbase (169,970 points)
edited 1 year ago by onur

Related errors