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
0
votes
3 answers

How to access property in extended class in Coffeescript?

I want to use @Type in a if statement, but it seems as if it is not recognizing @Type. Is there a way to get @Type so that I can use it in the superclass? class opponent constructor: (ID, Level, Name) -> @ID = ID @Level = Level …
LukeK
  • 125
  • 1
  • 2
  • 8
0
votes
2 answers

How do I access an array from a parent class in a child class?

I have a class where arrays are globally declared and public these arrays are initialized though methods in this class. They are not inside of a constructor. I have another class where I have used extends to allow me access to these values. Of…
handroski
  • 81
  • 2
  • 3
  • 15
0
votes
3 answers

Receiving a null pointer exception

I have a class that sets up an array. Another class extends this class and uses the mentioned array in a method to return another array. I am receiving a null exception when I do this however when I set up the original array, it works just fine. Not…
handroski
  • 81
  • 2
  • 3
  • 15
0
votes
2 answers

sub class does acquire the interface implemented by the superclass?

just a little question that can be stupid but i want to be sure of this. If i got 2 classes: ClassA and ClassB declared in this way public ClassA implements Usable... //Usable is an interface obviously ... public ClassB extends ClassA…
The BigBoss
  • 111
  • 2
  • 11
0
votes
1 answer

Java: If this is instanceof Something, display a variable that belongs only to Something?

Everything here is renamed and simplified. I have a parent class (normalThing) with a method that displays some data about the instance, and another class (specialThing) extending the parent to include another instance variable (addedPrice). I want…
Lenoxus
  • 545
  • 1
  • 4
  • 19
0
votes
0 answers

Weird behaviour with controllers

In my current application, I've some functionality that are shared by all the UIViewControllers, like HUDs, connectivity library, tab gesture, and so on. I've thought that a good way to avoid repeating code, would be to create a controller called…
0
votes
0 answers

PDO - Extending vs Injection

I've recently migrated from using MySQL to PDO. Originally, I had a class which was a wrapper for the MySQLi object, providing some basic functions and settings I used a lot. I want to do the same thing for PDO. I want PDO to always throw exceptions…
Lokicat
  • 129
  • 1
  • 7
0
votes
2 answers

Problems with fragments and inflating from main activity

I am trying to set up a fragmented application with the IOIO (sort of like arduino) framework; The problem is when I changed the extension of the IOIOActivity.java class from extending activity to extending FragmentActivity and then I build my…
Timothy Frisch
  • 2,995
  • 2
  • 30
  • 64
0
votes
2 answers

Extend Abstract Class with Generic Types?

How can I extent an abstract class like the following which has generic arguments? @Singleton public abstract class Presenter> extends PresenterWidget { ... }
Michael
  • 32,527
  • 49
  • 210
  • 370
0
votes
2 answers

TCPDF import variables to extension

I'm using TCPDF and Codeigniter. I'm trying to create a custom header with information from my MYSQL-DB: $header_content. Allthough I can't import the variable into the class MYPDF without getting an error tha the variable doesn't exits. How do I…
Line in Linus
  • 390
  • 8
  • 25
0
votes
4 answers

Java: Returning an extended class given it's name

In the following code I am returning a class that extends the type of Entity given the name of the class (it then corrects it so that Class.forName can find it properly). How can I modify this so that I can still return a class that extends Entity…
Nahydrin
  • 13,197
  • 12
  • 59
  • 101
0
votes
1 answer

ActionScript Extending Classes (Nesting ADVICE)

I've written Pacman in AS2, now I want to port it to AS3 using classes.... I'm looking for ADVICE on my approach to tackling this so far (feels like I'm going wrong already)... I've made a Console Class that holds program output and a container for…
0
votes
0 answers

Incorrect number of arguments As3

I made a class so that I can cut some from a class and store the extra code in this new class package { public class mainSetup extends Main{ public function mainSetup() { trace("I extend the main class"); } …
0
votes
2 answers

Calling a method through an extended class only works if the Method is overridden java

i have 4 classes (Core, GameMain, Spriter, Character) - GameMain extends core (core >> GameMain) - Character extends Spriter (Spriter >> Character) I get a NullPointerException if i call the - b.get...() - Methods without overriding them in…
OmAr
  • 97
  • 8
0
votes
1 answer

How can I implements ProgressBar class?

I want to edit onDraw method for my progressbar. But in my class I use extends to Activity class. When I search on the internet I see , I should extend to ProgressBar class. But I etends activity so How can I implements ProgressBar class? my…
user3086226
  • 93
  • 1
  • 7
  • 18
1 2 3
99
100