Covariant Return Type in Java || Important Interview Question

Поделиться
HTML-код
  • Опубликовано: 3 янв 2024
  • Java Interview Question
    In Java, covariant return type refers to the ability to override a method in a subclass with a return type that is a subclass of the return type of the method in the superclass. This feature was introduced in Java 5.
    Before Java 5, when you override a method in a subclass, the return type of the overriding method must exactly match the return type of the method in the superclass. However, with covariant return types, the return type in the subclass can be a subtype of the return type in the superclass.
    #Covariant #java #anchalsonilectures #covariant return type in java #what is covariant return type in java hackerrank solution #JavaProgramming
    #ask4help
    #covariantreturn_type

Комментарии • 1