Questions tagged [extends]
extends is a keyword in several programming languages used to denote implementation inheritance
extends
1,714
questions
0
votes
2
answers
48
views
How to upgrade Java class to extension class?
I have a simple problem. I have a large class:
public class Base {
public Field1Data field1;
public Field2Data field2;
public Field3Data field3;
// many more fields later...
public ...
1
vote
1
answer
61
views
Extending the object type of a function argument
I want to extend the function argument type by adding a function with any name to each object and return it, but i am facing a problem with naming the key of the added function
export type Expand<...
2
votes
1
answer
63
views
Why can't TypeScript override a method of the parent class with a derived type?
Here is a simple example.
type Callback<T> = (sender: T) => void;
class Garage<T> {
private callbacks: Callback<T>[];
public constructor(callbacks: Callback<T>[]) ...
1
vote
1
answer
33
views
In TypeScript why does [1, 2] extend [...unknown[], 0, ...unknown[]]?
I'm trying to understand how infer in TypeScript conditional types work. One thing I've noticed about infer types in TypeScript is that they are defined to allow a rest element following another rest ...
1
vote
0
answers
60
views
Class extends value undefined is not a constructor or null [vite build]
When I run the build of my Vite project I have this error
Class extends value undefined is not a constructor or null
migrating from CRA to vite
I have tried to place some keys on vite.config.js
my ...
1
vote
0
answers
64
views
PHP Extends through includes doesn't work with parent in file2 / child in file1
So i was making a basic code and came across this problem.
I first had all my code in one file, afterwards i split the different classes into individual files.
While doing that i was doing that i had ...
1
vote
0
answers
52
views
Using java super and exends with lambda expressions [duplicate]
I am fairly new to Java, currently learning about lambda expressions.
so I wanted to use generic with the Consumer function to make it accept any type of parameter passed to it and just print it out
...
2
votes
2
answers
49
views
How to implement Array-Like class in TypeScript? [duplicate]
I would like to create an Array-Like class and add some properties to it. So far I have this code:
class MyArray<T> extends Array<T> {
constructor(items: T[], data?: any) {
...
0
votes
0
answers
44
views
How do I add value to my Method call from my Sub class to Main?
The string value seems to appear yet I can not add a value to my calculations in the fulltime and part time.
This is the Main class for my inheritance
import java.util.Scanner;
public class ...
-2
votes
1
answer
39
views
Why do Exception classes that extend the base Java Exception class not get caught?
Given the following program:
public class App {
public static void main(String[] args) throws Exception {
int x = 0;
try {
throw new Exception2();
}
...
0
votes
1
answer
173
views
AHK V2 Class extends troubles
I'm not sure if I'm using classes wrong, but any assistance would be appreciated. I'm using Autohotkey V2 and I'm trying to make a class extend to another class.
Class Person{
__New(info){
this....
1
vote
2
answers
34
views
typescript: the method Status will be undefined during extends MemoryStream
If I remove the extends MemoryStream below, then everything works as expected - the status method can be called.
But if I use extends MemoryStream, then the status method becomes undefined.
What am I ...
1
vote
1
answer
107
views
Use case extends or include [duplicate]
I have 3 actors: User A, User B and Admin and the use case view photo that is linked with each actors. Now, I want to add a use case add to favourites, and this use case can be activated only by User ...
0
votes
0
answers
67
views
java se 8 rules for implementing abstract methods from extended interfaces
why does this code compile printing "Class 2" (java se8; eclipse) even if abstract method is NOT implemented in first concrete class?
IDE gives me the hint: The type Class1 must implement ...
0
votes
1
answer
151
views
Is it possible to inherit multiple classes? [duplicate]
I was studying for my Intro to Java I exam and I don't think I need to get this far into inheritance but it made me curious. I decided to practice with Pokémon because even though most of the examples ...