Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

In Kotlin, unlike Java, static members are not inherited by subclasses, even though they can be called inside a subclass without the base class name.

Outside a subclass, you have to call the base class static functions using the base class name:

WakefulBroadcastReceiver.completeWakefulIntent(intent) 

This behavior seems to lie within the companion objects concept: companion objects of classes in a hierarchy are not included into each other.

Interestingly, for interfaces the situation is a bit different: interface static members cannot be referenced in subclasses without the interface nameinterface static members cannot be referenced in subclasses without the interface name. This behavior is the same to that in Javathe same to that in Java.

In Kotlin, unlike Java, static members are not inherited by subclasses, even though they can be called inside a subclass without the base class name.

Outside a subclass, you have to call the base class static functions using the base class name:

WakefulBroadcastReceiver.completeWakefulIntent(intent) 

This behavior seems to lie within the companion objects concept: companion objects of classes in a hierarchy are not included into each other.

Interestingly, for interfaces the situation is a bit different: interface static members cannot be referenced in subclasses without the interface name. This behavior is the same to that in Java.

In Kotlin, unlike Java, static members are not inherited by subclasses, even though they can be called inside a subclass without the base class name.

Outside a subclass, you have to call the base class static functions using the base class name:

WakefulBroadcastReceiver.completeWakefulIntent(intent) 

This behavior seems to lie within the companion objects concept: companion objects of classes in a hierarchy are not included into each other.

Interestingly, for interfaces the situation is a bit different: interface static members cannot be referenced in subclasses without the interface name. This behavior is the same to that in Java.

added 129 characters in body
Source Link
hotkey
  • 149k
  • 43
  • 392
  • 333

In Kotlin, unlike Java, static members are not inherited by subclasses, even though they can be called inside a subclass without the base class name.

Outside a subclass, you have to call the base class static functions using the base class name:

WakefulBroadcastReceiver.completeWakefulIntent(intent) 

This behavior seems to lie within the companion objects concept: companion objects of classes in a hierarchy are not included into each other.

Interestingly, for interfaces the situation is a bit different: interface static members cannot be referenced in subclasses without the interface name. This behavior is the same to that in Javathe same to that in Java.

In Kotlin, unlike Java, static members are not inherited by subclasses, even though they can be called inside a subclass without the base class name.

Outside a subclass, you have to call the base class static functions using the base class name:

WakefulBroadcastReceiver.completeWakefulIntent(intent) 

This behavior seems to lie within the companion objects concept: companion objects of classes in a hierarchy are not included into each other.

Interestingly, for interfaces the situation is a bit different: interface static members cannot be referenced in subclasses without the interface name. This behavior is the same to that in Java.

In Kotlin, unlike Java, static members are not inherited by subclasses, even though they can be called inside a subclass without the base class name.

Outside a subclass, you have to call the base class static functions using the base class name:

WakefulBroadcastReceiver.completeWakefulIntent(intent) 

This behavior seems to lie within the companion objects concept: companion objects of classes in a hierarchy are not included into each other.

Interestingly, for interfaces the situation is a bit different: interface static members cannot be referenced in subclasses without the interface name. This behavior is the same to that in Java.

added 20 characters in body
Source Link
hotkey
  • 149k
  • 43
  • 392
  • 333

In Kotlin, unlike Java, static members are not inherited by subclasses, even though they can be called inside a subclass without the base class name.

Outside a subclass, you have to call the base class static functions using the base class name:

WakefulBroadcastReceiver.completeWakefulIntent(intent) 

This behavior seems to lie within the companion objects concept: companion objects of classes in a hierarchy are not included into each other.

Interestingly, for interfaces the situation is a bit different: interface functions cannot be called in subclasses without interface nameinterface static members cannot be referenced in subclasses without the interface name. This behavior is the same to that in Java.

In Kotlin, unlike Java, static members are not inherited by subclasses, even though they can be called inside a subclass without the base class name.

Outside a subclass, you have to call the base class static functions using the base class name:

WakefulBroadcastReceiver.completeWakefulIntent(intent) 

This behavior seems to lie within the companion objects concept: companion objects of classes in a hierarchy are not included into each other.

Interestingly, for interfaces the situation is a bit different: interface functions cannot be called in subclasses without interface name. This behavior is the same to that in Java.

In Kotlin, unlike Java, static members are not inherited by subclasses, even though they can be called inside a subclass without the base class name.

Outside a subclass, you have to call the base class static functions using the base class name:

WakefulBroadcastReceiver.completeWakefulIntent(intent) 

This behavior seems to lie within the companion objects concept: companion objects of classes in a hierarchy are not included into each other.

Interestingly, for interfaces the situation is a bit different: interface static members cannot be referenced in subclasses without the interface name. This behavior is the same to that in Java.

added 20 characters in body
Source Link
hotkey
  • 149k
  • 43
  • 392
  • 333
Loading
added 20 characters in body
Source Link
hotkey
  • 149k
  • 43
  • 392
  • 333
Loading
Source Link
hotkey
  • 149k
  • 43
  • 392
  • 333
Loading