1

Hi guys can you help me fix this error I am not sure what to do and I have been trying to resolve it for a long time, stackoverflow is not allowing me to post because my post is more code than is description but this is the error I am getting please help

/PROG3.java:38: error: cannot find symbol
    static int size = Taskdetails.getNumberOfTasks();
                                 ^
  symbol:   method getNumberOfTasks()
  location: variable Taskdetails of type String
1 error

I will appreciate your inputs

Pshemo
  • 122,468
  • 25
  • 185
  • 269
  • Most likely you are facing one of problems described at: [What does a "Cannot find symbol" or "Cannot resolve symbol" error mean?](https://stackoverflow.com/q/25706216) – Pshemo Jul 07 '22 at 20:16
  • 2
    It says `Taskdetails` is a variable of type `String`, and `String` does not have a `getNumberOfTasks()` method. The exact fix is impossible to guess without a [mre]. – Slaw Jul 07 '22 at 20:17
  • 2
    Based on `location: variable Taskdetails of type String` need to agree with @Slaw. This is good example why *variables* should start with `lowerCase` and *types* `UpperCase` so we could easier recognize or even prevent those kind of problems. – Pshemo Jul 07 '22 at 20:19

1 Answers1

1

You named a variable Taskdetails of type String. And in the line in the error message, you try to access its method getNumberOfTasks which is not present in the String class.

Valerij Dobler
  • 1,848
  • 15
  • 25