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

How to use classes that extends Activity in Android?

I am new to Android programming. Basically what I want to do is write a class that extends Activity and then use it in another class that also extends Activity. In my case what I wanted to do was to be able use GsmCellLocation class members without…
Sarp Kaya
  • 3,686
  • 21
  • 64
  • 103
0
votes
1 answer

Codeigniter : public, membre, admin

In this file I have something like that : class MY_Controller extends CI_CONTROLLER { public function __construct() { parent::__construct(); } } class MY_Membre_Controller extends MY_Controller { public function…
Choubidou
  • 351
  • 2
  • 4
  • 17
0
votes
2 answers

Sorting a collection of objects in Java where implementing class is final

I'm using a public API provided by a 3rd party and I have a collection of objects that are defined as final. The object has a method getName() which lets me retrieve the String name of the object. What I need to do is sort the objects by name and…
0
votes
3 answers

php copy variables to extended version of class

I have 2 classes that one of them extends another: class a{ private $name; public function __construct(){ } public function get($v){ $this->name=$v; } } class b extends a{ public $user; } at top of page I'm creating…
Hossein
  • 13
  • 4
0
votes
0 answers

Extending android Location class and implements parcelable interface

I have a Coordinate class that extends the android.location.Location class that implements Parcelable. Here is my Coordinate class : public class Coordinate extends Location { public Coordinate() { super(Keys.DUMMY_PROVIDER); } public…
Fred
  • 38
  • 8
0
votes
1 answer

Java SWT extending another class for Dialogs

Every dialog window in SWT should extend the Dialog class, but I also have my own class View, that my dialogs also should extend. OK, you should just make your View to extends Dialog, you can say. But the problem is, that my View shouldn't do it,…
ovnia
  • 2,412
  • 4
  • 33
  • 54
0
votes
2 answers

How to extend or implement classes?

Picture to show task: First I am sorry, for my bad to for expressing my mind. I have such a task, I don't need that you do it for me. Vehicle is parent class for Sedan (Cause Sedan class is String type). How to extend or implement Vehicle class…
galvakojis
  • 408
  • 1
  • 5
  • 19
0
votes
1 answer

What is the correct way to use extends on a static method that uses generics?

I am attempting to make a static method that uses generics. I would like the method to only take parameters of types that implement comparable. I have attempted to do this: public static > ArrayList>…
fdsa
  • 1,379
  • 1
  • 12
  • 27
0
votes
2 answers

The cause of java "incompatible types"?

import java.util.*; class Poly{ protected int[] coef = new int[1001]; protected int[] exp = new int[1001]; protected int len; protected void attach(int c, int e){ coef[len] = c; exp[len++] = e; } protected…
Steven Chou
  • 1,504
  • 2
  • 21
  • 43
0
votes
4 answers

When a superclass extends JFrame

I am trying to use a class which extends JFrame to build a GUI. ex : class Deck extends JFrame The GUI is built in its constructor. Now when I extend Deck from another class, ex : class Pile extends Deck New windows are being created whenever an…
Kari
  • 101
  • 1
  • 2
  • 4
0
votes
2 answers

Weird Generics Behaviour with Interface

I want to create a generic class that takes elements of some generic type that are comparable. So I do: public class Foo> and inside the class Foo I have things like: public void bar(T t) and I'm assured that I can write code…
insumity
  • 5,311
  • 8
  • 36
  • 64
0
votes
2 answers

accessing class variables from extended class with getter and setters

Im trying to access a variable from one class through another class from a php script: My first class is: class data{ private $length; private $height; public function setLength($length){ $this->length = $length; } public…
Yeak
  • 2,470
  • 9
  • 45
  • 71