» Home » Class » Page 1
Inheriting from a class that is based on a generic class but needs the class type of the derived class
by Luciano Campos in Programming Languages

I have a problem and not so sure how to solve it..

Consider the class:

public class BaseClass<T>
public T PreviousInstance { get; set; }

Now my secondary data class:

public class DataClass : BaseClass<DataClass>
public bool ABoolProperty { get; set; }


Class.Class vs Namespace.Class for top level general use class libraries?
by mitry in Programming Languages

Which one is more acceptable (best-practice)?:

namespace NP
public static class IO
public static class Xml
// extension methods
using NP;
IO.GetAvailableResources ();


public static class NP
public static class IO
public static class Xml
// extension methods

How come when I create a class derived from another GameComponent class, the game class will only update what's in the original class' update?
by witeken in Programming Languages

When I am creating my class ConfigsPC which is derived from another class which I created as a base class, Configs, I am not able to update anything in the Update method for the class ConfigsPC but I am able to update stuff in the Update method for the class Configs. This is my problem, I don't know what is wrong with

If i extend a static class in PHP, and the parent class refers to “self::”, will this refer to the self in the extended class?
by manivel in PHP

If i extend a static class in PHP, and the parent class refers to "self::", will this refer to the self in the extended class?

So, for example

Class A
static $var
public static function guess(){self::$var = rand(); return $var}
Class B extends Class A
public static function getVar(){return s

Can I define a class with no public constructor and place a factory method for this class objects in a different class in Scala?
by skulldrinker in Programming Languages

For example (maybe a bit clumsy from a real life view, but just to illustrate):

"User" is a case class containing user name and id. Id can be never set manually, and a User class instance with no id set has no sense.

A UserBase class maintains users base and has a "getUser (name : String) : User" method returning a consistent User instance.

No one other than

Objective-C and iPhone class initialization and accessing class objects created in init class
by Mytime34 in Mobile Programming

First off good day and thanks for taking the time to answer my question.

Some background:
I have done the same thing in a regular OS X program in that I run everything in main.m

What I'm doing:

making a VERY crude app that adds a FirstName and LastName text field. The user enters some text and when they press add to address book the program gets the s

@Override causes issues with class hierarchy involving interface, abstract class and concrete class
by timswim78 in Programming Languages

My classes are as follows

public interface A {
public void doSomething();
public abstract class B implements A {
public void doOneMoreThing() {
// Do one more thing
public class C extends B {
@Override <---- Causes error
public void doSomething() {
// Do something
Rails class loading skips namespaced class when another class of same name in root namespace is loaded
by MJRider in Programming Languages

I have two namespaces, each with its own controller and presenter classes:

Both presenters inherit from ::DocumentPresenter.

Controllers access their respective presenters without na

persistent class method not generating in util class class while using custom query in liferay
by aafr in Coding
package emenu.advertise.database.service.persistence;
import java.util.ArrayList;
import java.util.List;
import com.liferay.portal.SystemException;
import com.liferay.portal.kernel.dao.orm.QueryPos;
import com.liferay.portal.kernel.dao.orm.QueryUtil;
import com.liferay.portal.kernel.dao.orm.SQLQuery;
import com.liferay.portal.kernel.dao.orm.Session;

Ruby access derived class “class methods” from base class
by Geoff The in Development Tools & Services

I have a base class in Ruby that has a class method which it has inherited. I would like to call this method in the base class, but pass it an option which is specified by the derived class, like so:

class Base < SuperDuperClass
super_duper_class_method :option => my_option_value
def self.my_option_value
raise "Method my_option_value must be overridde

Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .