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
1 answer

extending signatures and atoms instantiation

I am using Alloy 4.2 and I have a complexity problem using inheritance. Apparently the inheritance between signatures does not behave as I used to face in object oriented programming (or at least as I expect). Apparently when the exactly keyword is…
user2858691
  • 125
  • 7
0
votes
2 answers

Django, particular url doesn't load stylesheets and js

In a djano app, in urls.py, I got 2 urls. Both extend 'base.html'. But when I go to the url, one of them doesn't load the .css, .js files etc. Any ideas? Urls.py below: from django.conf.urls import patterns, url urlpatterns = patterns('', …
manosim
  • 3,630
  • 12
  • 45
  • 68
0
votes
1 answer

What effects does extending have on memory in Java?

So when you make an instance of a class such as: class Example { public static void main(String[] args) { Example example = new Example(); } } Will anymore resources be used if I did: class Item { public Item() { …
Vince
  • 14,470
  • 7
  • 39
  • 84
0
votes
2 answers

Java - Inheritance Issue

I got a problem as I have been recently trying to write my own "library" with different well-known data structures such as linked lists, trees, tries, heaps, etc. Sadly, I got stuck while coding the first one (the linked list). For that, I wrote a…
user2775593
0
votes
0 answers

canvas java without extends

I'm trying to do a canvas object... is homework.. but I want to make a object Canvas obj=new Canvas(); but i can't draw.. package canvasobjeto; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import…
WearFox
  • 293
  • 2
  • 19
0
votes
2 answers

Nodejs - extend command doesn't work as expected

I've encountered a weird situation, I've been using the extend library and the _.extend command from underscore, in the following way: var extended = extend({}, objA, objB); I get only properties from one of the objects in the result, is there…
Madd0g
  • 3,841
  • 5
  • 37
  • 59
0
votes
3 answers

How do I store objects created into an ArrayList and return it?

I'm asked to create a method called listOfWorkers in which i will create objects of each type of the 3 workers I have by reading the data from the file "workers.txt" and then store the objects into an ArrayList of type Worker and return it. I have…
tonyisapony
  • 89
  • 3
  • 9
0
votes
2 answers

Extending ArrayList in order to add custom filter function

I have an ArrayList in an application. Each LineItem holds a line from a CSV file from another data source. LineItem is defined as follows: class LineItem { private Date date; private String clientname; private String…
Rick
  • 591
  • 1
  • 9
  • 23
0
votes
0 answers

PHP creating model best practices

I am creating some model classes for an API that I'm building in PHP, to give rigid structure to the JSON responses. Here is an example: class Model { public $id; public function __construct($id) { $this->id = $id; } } class…
Justin
  • 42,716
  • 77
  • 201
  • 296
0
votes
3 answers

java List extends abstract

I have a public abstract class Person{/*..*/} public class Woman extends Person{/*..*/} public class Man extends Person{/*..*/} I'm trying to instantiate a List that could contain either Man or Woman, I tried this : List
user3332598
  • 95
  • 1
  • 12
0
votes
1 answer

Returning extended custom object parameter from function in TypeScript and have VS intellisense show the extended properties

The only way I can properly explain what I'm trying to do is by example: function CustomExtend(myParam: Object): Object { return $.extend(myParam, { extraParameter: 'extraParam' }); } I want intellisense when using the CustomExtend function to…
Anupheaus
  • 3,383
  • 2
  • 24
  • 30
0
votes
4 answers

Java adding functionality to an existing class with a new class while still exposing all methods of previous class

I want to do something like a super() but without passing anything to the constructor. Something like copying all the variables in their current states, which were set to methods inside that class. I want to avoid doing stuff like getPlayer() in a…
SSpoke
  • 5,656
  • 10
  • 72
  • 124
0
votes
2 answers

Getting StackOverFlowError and unsure why?

The program I am trying to create is a basic game where the user inputs a grid size the selects blocks receiving either a prize which adds to the score, a bandit which takes points away from the score or a bomb to end the game. I am getting a stack…
user2985542
  • 61
  • 1
  • 2
  • 9
0
votes
3 answers

How can we define a class which extends the Exception class of java.lang class

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.*; public class sentence { public static void main() throws IOException { InputStreamReader br = new…
0
votes
2 answers

Need a way to add a function to query function of mysqli class

I am trying to implement a MySQL query execution time measurement on the existing site that is full of $db->query calls using the standart mysqli class $db = new mysqli($host, $user, $pass, $dbname, $port); what I would like to do is to extend the…