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

Can't extend backbone.events in coffeescript

I'm getting the error: Uncaught TypeError: Cannot read property 'constructor' of undefined When declaring the following class: class ViewHelpers extends Backbone.Events I can use the same syntax to extend Backbone.Router, Views, Model etc. Here…
benipsen
  • 493
  • 6
  • 12
14
votes
4 answers

inner class extending

In java, say I have the following class: public class A{ protected class B{ } } can I extend the inner class by doing the following? public class C extends A{ protected class D extends B{ } } What I want to do is that I have the class C…
user1082160
  • 195
  • 1
  • 1
  • 8
14
votes
2 answers

extending PDO class

Below is the db connection class I came out with so far, but I am going to improve it by extending the PDO class itself,
Run
  • 54,938
  • 169
  • 450
  • 748
14
votes
3 answers

Django: Extends or Include?

My friend and I are having a small argument. In my current Django Project, I have created a file called menu.html which will contain a bunch of links configured and formatted into a list. Instead of manually hard-coding the menu into each page, I am…
Reznor
  • 1,235
  • 5
  • 14
  • 23
14
votes
2 answers

Cannot cast to an Extended Class in Java

I looked around for a similar issue but couldn't find anything that matched it. I'm trying to extend the built-in JSONObject to add some functionality, like so: public class MyJSONObject extends JSONObject { // Easily return an integer from a…
Joshua Pinter
  • 45,245
  • 23
  • 243
  • 245
14
votes
3 answers

java, initialize SubClass from SuperClass

public class Base { //long list of attributes // no Constructor using fields // no init methode // i cannot change this class } now i extended the Base Class like: public class subClass extends Base{ private boolean selected; ... …
Rami.Q
  • 2,486
  • 2
  • 19
  • 30
14
votes
1 answer

Extending Android Application class

When I was searching for a solution to get the error reports from remote device, just like the test flight app in iOS, I found the acra for Android devices here In the basic set up they have said we need to add some lines in extends Application…
Siva K
  • 4,968
  • 14
  • 82
  • 161
14
votes
4 answers

In PHP can you extend a class to the same name?

I'm trying to find out weather I can do this or not. I have a class called Template. and I want to extend that classes functionality in another file, but I don't want to change the name. Do I declare it as class template extends template { //…
Matt Lima
  • 307
  • 2
  • 6
13
votes
3 answers

Quitting Smarty to do it manually

I am facing the problem that I'm not really sure how to develop without a framework or a template engine. I started coding that way and now I want to go to basics. I used to work with this MVC schema, using Codeigniter and Smarty as a template…
Limon
  • 1,772
  • 7
  • 32
  • 61
13
votes
5 answers

Why generic type is not applicable for argument extends super class for both?

Here is the problem that I have been being tried to find the solution. We have two class definitions. One of two extends other one. class T{} class TT extends T{} The requirement is that there should be a list keeps object extends T …
codelovesme
  • 3,049
  • 1
  • 16
  • 18
13
votes
2 answers

PHP - Extending Class

I've done lots and lots of code in PHP that is object-oriented, but up until now, all of my classes have been, "singular", I suppose you can call it. I am in the process of changing several classes (that have 5 or so identical methods) to extend…
TheLettuceMaster
  • 15,594
  • 48
  • 153
  • 259
12
votes
3 answers

What is the proper way to extend a class in another file?

This is what I have in foo.php class Foo { public $foo = NULL; public $foo2 = NULL; public function setFoo ($foo, $foo2) { $this->foo = $foo; $this->foo2 = $foo2' } } This is what I have in foo3.php class Foo3…
diesel
  • 3,337
  • 4
  • 20
  • 16
12
votes
3 answers

Java Inner Class extends Outer Class

There are some cases in Java where an inner class extends an outer class. For example, java.awt.geom.Arc2D.Float is an inner class of java.awt.geom.Arc2D, and also extends Arc2D. (c.f.…
amaidment
  • 6,942
  • 5
  • 52
  • 88
12
votes
5 answers

How to Inherit A Model from Another Model in CodeIgniter

i'm using codeigniter for my project and i have this class model which i call Genesis which looks like this: class Genesis_model extends CI_Model { function __construct() { parent::__construct(); } function get() { …
dqiu
  • 327
  • 2
  • 5
  • 15
12
votes
3 answers

Flutter Override PopupMenuButton Widget to prevent soft keyboard to close

In my flutter mobile application, I use a PopupMenuButton placed at the bottom of the view. If I click on it, the soft keyboard is dismissed because the text input looses the focus I guess. So the popup menu does not show at the right place. I would…
Damien Morattel
  • 183
  • 1
  • 8