Questions tagged as 'constructor'

3
answers

Abstract class with constructor

Can a clase abstracta of Java have constructor ? And if so, what are your goals?     
asked by 02.12.2015 / 13:55
2
answers

C ++ error no matching function for call to 'Node :: Node (point &, float &, Node &)'

I have an error in the code, precisely in the constructor, the compiler says that I am not passing the appropriate parameters, to put in context, this is the class that the constructor has, I only put the relevant functions to understand the dou...
asked by 20.11.2018 / 00:56
1
answer

Motion constructor in C ++

I am studying the movement constructor in C ++ that receives a reference to an r-value of the type of the class. The problem is that despite seeing several C ++ Deitel books and several others, I can not find anything of the movement builder...
asked by 17.01.2018 / 12:49
1
answer

You doubt how the return works

I have a question, I've been going around for a few days, and I can not understand how it works or what I'm doing wrong. Starting point: Suppose we have the following function: ArrayWrapper f(ArrayWrapper arr){ return arr }...
asked by 25.05.2018 / 01:49
3
answers

How to declare a list of objects and then assign data? C #

I tried to find information about it and found that I can declare the list as follows: var list= new List"object"; but I do not take well the different types of syntax I find from examples on the Internet. How should I declare the list?...
asked by 17.05.2018 / 16:05
5
answers

class rectangle, problem Deitel set and get

They ask me to create a rectangle class with length and width.    8.4 ( Rectangle Class ) Create a class named Rectangle with the length and width attributes, each with a default value of    1 You must have methods to calculate the per...
asked by 18.10.2016 / 04:58
2
answers

How to join in a constructor three constructors with different signatures?

I have three constructors of a simple class A with different signatures but I wanted to make a single constructor that brings together the three constructors: using namespace std ; class A { private : int x, y; public : A();...
asked by 08.02.2017 / 13:49
1
answer

Constructor with member variable?

I have a question about the following main #include "Pokemon.h" int main() { Pokemon piplup("Piplup", Pokemon::Agua); piplup.mostrar(); cout << endl << endl; } I must say that the main is a reference that the teacher passed us...
asked by 11.11.2018 / 01:03
2
answers

Is there a default constructor with no variable that needs to redefine the child classes in C ++?

When compiling a program, I have a curious error: MaxSize.cpp: In constructor ‘MaxSize::MaxSize(int)’: MaxSize.cpp:7:26: error: no matching function for call to ‘TasMin::TasMin()’ MaxSize::MaxSize(int size){ In file included from MaxSize.h:1:...
asked by 25.04.2017 / 17:59
1
answer

Observer type bool C ++

I'm trying to solve this exercise: The Dice class manages the launch of 2 dice. A) The constructor receives two optional parameters with the initial value for the given 1 and the given 2 respectively. If the dice do not receive an initial...
asked by 25.08.2018 / 13:33