Java Override or Overload

class 1:

public class Building implements Comparable <Building>
{
   @Override
   public int compareTo(Building o)
   {
      //does something...
   }
}

class 2:

I've been asked to Override compareTo in Cinema class.

Is the next considers Override or Overload?

public class Cinema extends Building
{
   //Override or Overload?
   public int compareTo(Cinema o)
   {
      //does something...
   }
}


Read more here: https://stackoverflow.com/questions/67012462/java-override-or-overload

Content Attribution

This content was originally published by Losnikov at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: