Unsure why I cant call a method from a class

image

Why does it say my DATE class or method doesnt exist?
probably missing something silly but new to processing.

1 Like

Welcome to the forum!

Nice to have you here -

To make a DATE you have to pass the parameters like

DATE myDate = new DATE ( 17,12, 2019);

the numbers of parameters must match

Convention

The Convention has it like this:

  • Constants ALL_UPPER_CASE
  • class names like Date UpperCase
  • objects smallCase
  • arrays plural and smallCase

Please post your code as text not as image

Regards, Chrisir

2 Likes

You need to add an explicit default constructor and you need to change the last method to use the constructor like this


class Date {
  int d;
  int m;
  int y;

  Date() {
  }

  Date(int day, int month, int year) {
    d = day;
    m = month;
    y = year;
    println(d, m, y);
  }
}

public void dates() {
  new Date();
}
2 Likes