9 Topics

Member Avatar for
Member Avatar for Doogledude123
Member Avatar for Pyler

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 public interface SomeList<T>{public void plus(T something);public E …

Member Avatar for JamesCherrill
0
402
Member Avatar for mesbahuk

In java this is how a DerivedClass can implement it's BaseClass's constructor. public DerivedClass extends BaseClass { //some properties public DerivedClass(param) { super(param); } } 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 …

Member Avatar for Ketsuekiame
0
263
Member Avatar for rahul.ch

<? 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! import java.util.*; class Cat {} class Animal{Animal() {System.out.println("Animal constructor");}} class Dog extends Animal{Dog() {System.out.println("Dog constructor");}} public class GenericDemo5 …

Member Avatar for rahul.ch
0
335
Member Avatar for rahul.ch

class Sample1 { Sample1() {System.out.println("Sample1 const"); } void doStuff(){System.out.println("sample1 dostuff"); } } class Sample2 extends Sample1 { Sample2() {System.out.println("Sample2 const"); } } public class Sample3 extends Sample2 { Sample3() {System.out.println("Sample3 const"); } public static void main(String r[]) { new Sample3().go(); } void go() { super.doStuff(); } } The output is: …

Member Avatar for rahul.ch
0
194
Member Avatar for athulram

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 …

Member Avatar for BenzZz
0
200
Member Avatar for JoshuaBurleson

In one of the books I'm using to study Python I keep seeing things like: [CODE] class Application(Frame): super(Application, self).__init__(master): self.grid() self.bttn_clicks=0 self.create_widget"""which is another function in the class"""[/CODE] Why is the super necessary for the class if the class it's calling is itself?

Member Avatar for JoshuaBurleson
0
256
Member Avatar for HiHe

This works with Python 2.7 [code]class B: def __init__(self, arg): print(arg) class C(B): def __init___(self, arg): super(C, self).__init__(arg) c = C('abc') # abc [/code]Here super() gives a TypeError: must be type, not classobj [code]from math import pi class Circle: """with Python3 object is inherited automagically""" def __init__(self, r): self.r = …

Member Avatar for HiHe
0
278
Member Avatar for khess

[URL="http://www.ubuntu.com"]Ubuntu[/URL] 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 …

Member Avatar for khakilang
7
761

The End.