Skip to main content

Questions tagged [extends]

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

extends
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 ...
tuskiomi's user avatar
  • 183
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<...
Vitaliy Severniy's user avatar
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>[]) ...
Pascal's user avatar
  • 77
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 ...
vijrox's user avatar
  • 1,146
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 ...
Bruno Leandro's user avatar
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 ...
Teramisu's user avatar
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 ...
Mohamed Hossam's user avatar
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) { ...
Mike Cenker's user avatar
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 ...
玉ねぎ忍者's user avatar
-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(); } ...
KodyN's user avatar
  • 9
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....
UnusualSoul's user avatar
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 ...
SkyN's user avatar
  • 1,533
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 ...
sco's user avatar
  • 37
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 ...
LaVeron's user avatar
  • 11
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 ...
CynicalBlitz's user avatar

15 30 50 per page
1
2 3 4 5
115