Loading...
Logo
Processing Forum
Hello to all.
When you start a library the Eclipse Library template provide a class. let's call it Class1. 
If I crate two more classes (classA and classB) and I want to instantiate ClassB into class1 works ok. But If I need to instantiate ClassB into ClassA I got an error: ClassB cannot be resolved to a type.

code example:

Copy code
  1. public class ClassA{
  2. PApplet parent;
  3.       public ClassA(PApplet myParent)
  4.       {
  5.             parent = myParent;
  6.       }
  7.       public void Foo()
  8.       {
  9.       ClassB cb = new ClassB(); //error -> cannot be resolved to a type.
  10.       }
  11. }

Copy code
  1. public class ClassB
  2. {
  3. public ClassB() //empty constructor
  4. {

  5. }
  6.       
  7.      public int[] RandomNumbers(int cant)
  8.       {
  9.             return random numbers
  10.       }
  11. }

 thanks in advance
regards
C.

Replies(1)

Strange, it should work.
Are they in separate files of same name than the class?
Are they in the same package?