Project Link https://www.codecademy.com/courses/learn-java/projects/java-prime-directive
My code:
I am new to Java Programming and I want to ask a question I had when I was doing the project.
In line 33 I tried to print isPrime(7) but I had an error. I then fixed it by printing pd.isPrime(7) and it worked. I am really confused about this since in line 24, I was able to call isPrime(number) directly without the prefix pd. . I would like to know when I am able to call a method directly.
Could you help me? I really appreciate it!