28 Discussion / Question Topics

Remove Filter
Member Avatar for
Member Avatar for zachattack05

If I implement an abstract class that contains this method: private void MyMethod(string awesomeParameter, int aBigNumber) { // something cool happens here! throw new NotImplementedException(); } can I change it to this without breaking the implementation? private void MyMethod(string myParam, int myInt) { // something cool happens here! throw new …

Member Avatar for ddanbe
0
295
Member Avatar for G_S

Hello everyone. I am currently making some database connection modules in Python inb order to learn Python's approach to OOP and also to lear how to connect to databases via Python. I successfully made a package with modules for postgres, mysql, sqlite3, and MongoDB. The classes simply connect, disconnect and …

Member Avatar for Gribouillis
0
513
Member Avatar for VengefulToast

Hi fellow members, I have wrote two abstract classes, with the second inheriting from the first. However, I receive this error when I try to compile: "error C2143: syntax error : missing ',' before '<'." Will somebody help me out? Thanks! template <class DataType> class AbstactArrayClass { friend ostream& operator …

Member Avatar for mike_2000_17
0
279
Member Avatar for CoilFyzx

Hello good day. Here is my problem: I have retrieved some a couple sets of data from my sql database and saved them in ArrayLists of (custom)types <Student> and <Subject>. I am using a single Table. I want to create a custom AbstractDataModel that displays the data from the ArrayList<Student>. …

Member Avatar for CoilFyzx
0
1K
Member Avatar for klemme

Hi all, I am trying to lay out a plan for my classes, and havent godt the most experience in oop yet. I am using an abstract class, to be able to have a more clear overview and keep the project easier to manage. SO: I have created two abstract …

Member Avatar for diafol
0
327
Member Avatar for tanatos.daniel

I have an abstract class CArticle and two derived classes CBook and CMagazine. I also have a class CLibrary where i want to add articles. Its members are an int variable to count the articles and a double pointer of CArticle. I have the following main function: int main() { …

Member Avatar for tanatos.daniel
0
447
Member Avatar for CPT

Currently I have something like this: class FileWritter{ ofstream file; public: FileWritter(string filename,A_Class a){//A_Class is class which has defined the >> and the << operators file.open(filename.c_str()); file<<a; } ~FileWritter(){ file.close(); } }; what I want is to have something like this: template <class AbstractClass> class FileWritter{ ofstream file; public: FileWritter(string …

Member Avatar for mike_2000_17
0
505
Member Avatar for nickerst

So I have been working on this project for quite some time and I can't figure out why I keep getting an "Illegal Start of Expression" error. I tried moving the variables above the main method and that only returned the same error but instead of the error occuring at …

Member Avatar for nickerst
0
318
Member Avatar for xtinab

For a project I'm doing for class I have to make a virtual method in a class. A subclass will inherit the virtual method and instantiate it in a separate .cpp file. The problem I'm having is that I need the class that has the virtual method to instantiate its …

Member Avatar for Ancient Dragon
0
219
Member Avatar for konman795

Hello all, I have an assignment in which I need to subclass and implement an abstract method (java.io.OutputStream) to create an output stream called NumStream. The NumStream class converts digits to strings. We are given most of the code it seems and I need to only implement one area. It …

Member Avatar for ztini
0
231
Member Avatar for konman795

Hi all, this is a homework assignment that I'm not sure how to begin with. We are given all the code and I just need to finish a function to convert digits to words. For example, the string "1, 2, and 3." becomes "One, Two, and Three." The String "10" …

Member Avatar for konman795
0
337
Member Avatar for ThaiAmL

Writing an abstract class for homework - here's what I have so far: [CODE]public abstract class Pet { String petName; double foodAmount; double foodSupply; int days; public Pet(String petName, double foodSupply) { //constructor to be used by sub-classes this.petName = petName; this.foodSupply = foodSupply; } public Pet() {//default constructor } …

Member Avatar for stultuske
0
690
Member Avatar for ThaiAmL

Hello! I'm doing my first homework assignment with abstract classes and interfaces. I have a few questions: (1) I know that a class must be saved on the computer as, for example, Class.java. Is this the same for abstract classes? How are interfaces supposed to be saved? Do they need …

Member Avatar for ThaiAmL
0
176
Member Avatar for ThaiAmL

I'm working on a program for an intro to java class and am supposed to use the following interface: [CODE]public Interface Animal{ //The animal is first supposed to "speak" and then it gets to eat //As long as the food supply lasts public void feed(); //The animal eats public void …

Member Avatar for ThaiAmL
0
225
Member Avatar for Peter4n31

Hello, I need to update my older Autodesk plug-in. And I am having troubles get it through. (They changed one function) This is a new definition which I cannot change: [CODE] CoreExport virtual void EnumAuxFiles(AssetEnumCallback& assetEnum, DWORD flags);[/CODE] And here is my code: [CODE] class CheckFileNames: public AssetEnumCallback { public: …

Member Avatar for Peter4n31
0
364
Member Avatar for Labdabeta

I have been teaching myself algorithms and I am stuck with the AlphaBeta AI algorithm. I want to test my knowledge of it with a TicTacToe simulation. The thing is I want it to be easy to modify for any two player game and I cannot figure out how to …

Member Avatar for Labdabeta
0
164
Member Avatar for logicmonster

I'm getting into some territory I have never treaded before.... What I have is an Abstract class "Person" with an abstract class "Employee" that extends "Person" and then three concrete classes within "Employee" named: Agent, Accountant, and WebDesigner. sudo: [CODE]abstract class Person{ abstract class Employee extends Person implements myInterface{ class …

Member Avatar for logicmonster
0
261
Member Avatar for superjj

Hi I want to make an abstract method. But I always get the error " cannot declare a body because it is marked abstract." When I delete the return then I get the error than I need a return. can someone help me please [CODE] public abstract Graphics drawRectangle(Graphics drawarea) …

Member Avatar for Mitja Bonca
0
176
Member Avatar for bangor_boy

As the title says i am trying to define RPC Calls, layers of software abstraction and serialization. I have came up with the following but confused at the last one, any help would be great Serialisation- Serialisation is the process of converting a data structure or object into a format …

Member Avatar for TrustyTony
0
140
Member Avatar for bangor_boy

Learning about Abstract classes and interfaces, is there anything else I have forgotten about? [B]Abstract Class[/B] 1.Cannot be initated. 2.Can have concrete methods. 3.Abstract methods with no body 4.A class extending the abstract class does not need to use all the abstract methods from the abstract class. 5.A class can …

Member Avatar for stevanity
0
244
Member Avatar for galhajaj

Hi :) i am new in C# and i am a little confused with the abstruct, virtual and override terms in C#... why they are good for? i tried to google it but i got more confused... for example - i am making a chess program and i made a …

Member Avatar for Mitja Bonca
0
178
Member Avatar for lacoffo

Hey all:) I'm learning Java and I'm having a little trouble on a polymorphic write-to-file function. Let me quickly explain my project: I have an abstract class Mammal, with non-abstract children Horse, Cow etc. I have a Main program that creates a couple Horses and Cows, and store these in …

Member Avatar for lacoffo
0
257
Member Avatar for java beans

Im trying to to create a simple 4 function calculator using a jump table without switch case or if/else statements. I understand I can create the jump table via function pointers but I am kindda blanking out. I've started with the addition and subtraction part of the program but am …

Member Avatar for JamesCherrill
0
413
Member Avatar for Castiel1631

I am trying to create an abstract data type for matrices. I have a function matrixInit to dynamically allocate memory for the structure and for the array. matrixCopy copies one matrix into another. there are functions to subtract, add and multiply matrices that return a pointer to memory where the …

Member Avatar for Thaylo
0
1K
Member Avatar for roro-

Ok it's all about to create 4 class Class a , class b derived from a and c derived from b and test class Speed is an instance variable in class b and c. The method are : Start() -a method of all class to print the message"hee" override the …

Member Avatar for roro-
0
245
Member Avatar for Castiel1631

I am creating an abstract data type for strings implementing the string functions but not using the string library. I have my .c file and my .h file below. The problem seems to lie in addMystring I have commented out the area's that seem to have the problem. when they …

Member Avatar for Castiel1631
0
2K
Member Avatar for zahnsoftware

When is it appropriate to use abstracts as opposed to interfaces to define base class behavior? What is the most common, practical usage for each? For instance, if I were to write a database applications that required to read a wide variety of database formats, would I define by database …

Member Avatar for embooglement
0
185
Member Avatar for ddanbe

As all textbooks on C# will tell you, you cannot instantiate an abstract class. I believe the keyword [B]abstract [/B]was intended for that purpose. So can anyone tell me why I can do something like this: [CODE=c#]abstract class TwoDShape { // some code here } class test { static void …

Member Avatar for CloneXpert
0
135

The End.