Questions tagged [extends]

extends is a keyword in several programming languages used to denote implementation inheritance

extends is a keyword in several programming languages which support object-oriented programming used to denote implementation inheritance (as opposed to implements used to denote interface inheritance).

Related

1708 questions
23
votes
2 answers

How to Inherit or Extend typeDefs in GraphQL

I have a type User. Users can also be a type TeamMember. The only difference between a User and TeamMember is an added field teamRole: String. So, I’d love to do something like the following to avoid having to redundantly define all the user's…
Chris Geirman
  • 9,474
  • 5
  • 37
  • 70
22
votes
3 answers

How to find the overridden method in Eclipse?

When I am looking at a method in eclipse java, how do I jump to the method it overrides/extends?
andreas
  • 267
  • 2
  • 9
21
votes
2 answers

Kotlin Error : 'public' function exposes its 'public/*package*/' return type argument

I am new to Kotlin and trying out to write some project using the language. I am using Java library and extending a class from the library in my project and I am seeing this error message. 'public' function exposes its 'public/*package*/' return…
Zuerst
  • 217
  • 1
  • 2
  • 5
21
votes
4 answers

extend base.html problem

I'm getting the following error: Template error In template /home/mo/python/django/templates/yoga/index.html, error at line 1 Caught TemplateDoesNotExist while rendering: base.html 1 {% extends "base.html" %} 2 3 {% block main %} 4

{{…

momo
  • 1,045
  • 3
  • 9
  • 18
20
votes
1 answer

How to handle NestJS Dependency Injection when extending a class for a service?

I am trying to provide a different service based on a value from my ConfigService. The problem I am running into is that the mongoose model that gets injected does not return any values when executing query methods such as findOne() (result is…
cameronliam
  • 217
  • 1
  • 2
  • 9
20
votes
5 answers

Collection vs Collection

After trying to understand the concepts at Spring MVC, I came across the expression Collection which I have never seen before. I have tried to figure it out on my own, but I am seeing no difference between using Collection
Evorlor
  • 7,263
  • 17
  • 70
  • 141
19
votes
4 answers

Having 2 variables with the same name in a class that extends another class in Java

Following is a part of my code for a project: public class Body extends Point{ public double x, y, mass; public Body() { x = y = mass = 0; } public Body(double x, double y, double mass) { this.mass = mass; …
Martin Andersson
  • 1,801
  • 4
  • 21
  • 25
18
votes
2 answers

Java: Are this.foo() and super.foo() the same when foo() is in the super class?

Say I have the following classes: class Foo { protected void method() {} } class Bar extends Foo { } At this point, from the class Bar, I have access to method() in two ways: super.method(); this.method(); From what I see, they seem to…
Magnus Bull
  • 1,027
  • 1
  • 10
  • 21
18
votes
2 answers

Behavior of strictfp keyword with implementing/extending an interface/class

JLS strictfp Interfaces specifies that : The effect of the strictfp modifier is to make all float or double expressions within the interface declaration be explicitly FP-strict (§15.4). This implies that all nested types declared in the interface…
Naruto Biju Mode
  • 2,011
  • 3
  • 15
  • 28
18
votes
1 answer

PHP - extend method like extending a class

I have 2 class: class animal{ public function walk(){ walk; } } class human extends animal{ public function walk(){ with2legs; } } This way, if i call human->walk(), it only runs with2legs; But I want the run the…
Tony
  • 425
  • 1
  • 5
  • 12
18
votes
2 answers

Derived class defined later in the same file "does not exist"?

Let’s suppose we’ve got two php files, a.php and b.php Here’s content of file a.php:
Michele Locati
  • 1,655
  • 19
  • 25
18
votes
4 answers

Common Header in different activities using BaseActivity in android

I want write code once and use in different activities. I have created a Base Activity class for that . Also the header of all the layouts in different activities are same. I have done that with the help of the tag. Now the…
ADB
  • 567
  • 2
  • 5
  • 20
16
votes
5 answers

Way to make inheritance in Vuex modules

Im building my app with VueJS and Vuex and I'm facing the issue when I have Multiple modules using the same data fields. Its about API configuration like dat. getUsers ({ state, commit }) { axios.get(urls.API_USER_URL).then( response => { …
Canor
  • 909
  • 1
  • 8
  • 25
16
votes
2 answers

PHP autoload and static variable in function

=== Base.php ===
Jelly
  • 189
  • 5
15
votes
1 answer

Dart: extends generic class with restrictions

Is this the correct way to declare a "generic class" that extends another "generic class" in dart? Note that the generic parameter has a type restriction. // available types class BaseType {} class DerivedType extends BaseType {} class…
Cequiel
  • 3,505
  • 6
  • 27
  • 44