135 Topics

Member Avatar for
Member Avatar for lytnus

I have a design question which I have not been able to find a satisfactory answer for by searching. Essentially, I have a class - Base - that contains a vector of pointers to another class - Node. However, I would like to be able extend both the Base and …

Member Avatar for lytnus
0
277
Member Avatar for oscarp

Hi, I have a map of a base class object (not pointer to objects). I did this because I need to have inheritance from others types like this: Parameter RealParameter: Parameter IntParameter: Parameter ... My problem is that when I am going to insert in the map, copy constructur of …

Member Avatar for mike_2000_17
0
2K
Member Avatar for majestic0110

I just wanted to demonstrate a quick point regarding Constructors & inheritance. Look at these two classes and think about what you might expect to see after the main method has run. Notice that ClassB is a subclass (inherits from) of ClassA. So, what do we expect the output to …

Member Avatar for masijade
3
580
Member Avatar for jagan605

I have recently learned in school about the dreaded diamond.And I wrote a program using virtual inheritance to overcome the problems.I use g++ and I have the following errors with this program, [CODE]//doing to create an illustration for dreaded diamond #include<iostream> using namespace std; class vehicle { public: virtual void …

Member Avatar for Fbody
0
552
Member Avatar for steaky1212

Hi, A bit of a tricky question, so I will try to explain everything in its fullest. I am trying to replicate some of the Terrarium work done by the Microsoft guys, but I dont want to look at any of their code. Anyway I have my base class which …

Member Avatar for nick.crane
0
204
Member Avatar for daudiam

[CODE]class A extends B { C ob1=new C(); D ob2=new D(); protected void finalize() { System.out.println("Finalizing A"); super.finalize(); } public static void main(String ss[]) { new A(); System.gc(); } }[/CODE] Though System,gc() doesn't guarantee the running of finalization, my question is if the JVM is able to run the finalizations …

Member Avatar for daudiam
0
255
Member Avatar for dohpaz42

In a nutshell I am trying to write a program that will connect to a database, query several tables for various sets of data that will then be transformed into XML that is stored into a file on the local hard disk. My first thought process to solve this problem …

Member Avatar for dohpaz42
0
193
Member Avatar for vs.vaidyanathan

When i run this, i get an error message saying TYpe expected and it points to the line having a.drive(100)... Any help please? Newbie... [code] class Car { public Car(){ int odometer=0; System.out.println("Car constructed!"); } public void drive(int miles) { System.out.println("Driving....."); odometer+=miles; } public long odometer; } class Guzzler extends …

Member Avatar for NormR1
0
251
Member Avatar for stevebush

Hi, I am working on assignments that deal with Generics in java. I have a class Movie that have a String name variable. However I have to add a few more properties to Movie objects like Release year and Director name. So I created an Inventory class that uses the …

Member Avatar for JamesCherrill
0
104
Member Avatar for tyson.crouch

G'day, Just a simple question. Does MySQL Support Inheritance? I understand that both Oracle and PostgreSQL support Inheritance, but haven't seen anything in MySQL regarding this. Regards, TC

Member Avatar for griswolf
0
117
Member Avatar for corby

hey guys/gals. i get a segmentation fault whenever the for loop in the print function is executed. any suggestions? im not sure what i did wrong. [CODE]//class member functions #include "experiment.h" #include <iostream> #include <fstream> #include <cstdlib> #include <iomanip> using namespace std; int Experiment::numberOfTests = 0; Experiment::Experiment(){} void Experiment::setExpName() { …

Member Avatar for Ancient Dragon
0
159
Member Avatar for enigmaYes

Hey guys. This is an assignment I've been given by my professor for a C++ course. The assignment description is below: [COLOR="Green"]Create a class ThreeDShape that has a default constructor and pure virtual functions double getSurfaceArea(), double getVolume() and void print(). Function getSurfaceArea() should compute and return the surface area …

Member Avatar for NathanOliver
0
237
Member Avatar for jonyb222

Good evening Daniweb, I have another idiotic problem which comes from making an arrival subclass out of Event. I have a few other subclasses of Event and they aren't giving me any trouble. I have tried to copy/paste/rewrite to eliminate any stupid typos. Arrival.h:7: error: expected class-name before ‘{’ token …

Member Avatar for jonyb222
0
550
Member Avatar for fadia

I'm working on this program. There are 3 classes. These two classes [COLOR="Red"]PassengerMenu and SecurityMenu[/COLOR] are inherited from the class [COLOR="Green"]MainMenu[/COLOR] So the main menu would provide the logo and a description (normal cout). Also an access to either the passnger menu or the security menu. according to your choice. …

Member Avatar for fadia
0
165
Member Avatar for Acegikmo

[B]This has been solved! Look at the end of this post.[/B] Hello! I'm having some trouble here with polymorphism, as I need to access methods in a subclass from an array of superclass objects. This method is called parseCommand(Command c); The method exists in the superclass and is overridden in …

Member Avatar for masijade
0
257

The End.