Class instance error.
in
Library and Tool Development
•
4 months ago
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:
- public class ClassA{
- PApplet parent;
- public ClassA(PApplet myParent)
- {
- parent = myParent;
- }
- public void Foo()
- {
- ClassB cb = new ClassB(); //error -> cannot be resolved to a type.
- }
- }
- public class ClassB
- {
- public ClassB() //empty constructor
- {
- }
- public int[] RandomNumbers(int cant)
- {
- return random numbers
- }
- }
thanks in advance
regards
C.
1