Member Avatar
Is there a way to require a subclass to call super explicitly in it's constructor?
by Doogledude123 45 in Software Development ()
Member Avatar
I'm trying to create a list stack that implements some interface called SomeList The list stack should only use stack with no links. the itnerface has a number of methods that I would like to implement. So for SomeList I have something like In the method above (plus(T something)) I …
by Pyler in Software Development ()
Member Avatar
In java this is how a DerivedClass can implement it's BaseClass's constructor. I have learnt C-Sharp's base() does the similar thing, but when I replace super(param) with base(param), it does not gives what I'm expecting. How can I implement this code snippet in C#?
by mesbahuk in Software Development ()
Member Avatar
<? super Animal> means animal or it's superclass only. Then why inside the method it's allowing to add Dog object even though it's a subclass of Animal? This program compiles and runs! Even with Generic Instantiation(shown below) same output!! This also compiles and runs! And it gets more peculiar! If …
by rahul.ch in Software Development ()
Member Avatar
The output is: Sample1 const Sample2 const Sample3 const sample1 dostuff My doubt is that super.doStuff() should invoke Sample2 method doStuff() if present. Why has it "propagated" upwards? I thought that happened only with no-arg super() being put implicitly (if not present) as first line of constructor.
by rahul.ch in Software Development ()
Member Avatar
My site needs a way to know whether a user is an admin or not in multiple pages. So is it safe to store whether a user is an admin or not in session variable? Or is there a better alternative (Maybe another superglobal variable?), It will only hold a …
by athulram in Web Development ()
Member Avatar
In one of the books I'm using to study Python I keep seeing things like: class Application(Frame): super(Application, self).init(master): self.grid() self.bttn_clicks=0 self.create_widget"""which is another function in the class""" Why is the super necessary for the class if the class it's calling is itself?
by pyguy62 23 in Software Development ()
Member Avatar
This works with Python 2.7 class B: def init(self, arg): print(arg) class C(B): def init___(self, arg): super(C, self).__init(arg) c = C('abc') # abc Here super() gives a TypeError: must be type, not classobj from math import pi class Circle: """with Python3 object is inherited automagically""" def init(self, r): self.r = …
by HiHe 174 in Software Development ()
Member Avatar
Ubuntu has redeemed itself with its latest version 9.10 (Karmic Koala). I took a look at Ubuntu 9.10 on October 1st and have been playing around with it for a few days. My first impression is that it is good stuff--seriously good stuff. From the new, updated installer to the …
by khess 81 in Linux and Unix ()