Questions tagged as 'construtor'

1
answer

char and constructors in c ++

I need a constructor for a class that has char vectors as attributes, like this: class Anthem { private: int Id; char Name[50]; char Country[50]; int Year; char Composer[30]; char Historic[20...
asked by 30.05.2018 / 20:04
1
answer

JavaScript Constructor is not a constructor error

I have a constructor and I wanted to create an object from it. But, giving Uncaught TypeError: Map is not a constructor.    I just wanted to know why? var mapa = null; var Map = (function (ol, $) { function Map(params...
asked by 06.04.2018 / 22:37
1
answer

PHP constructor does not identify variable value

Could someone tell me why in "parent :: __ construct ('$ account');", if I put a variable there, does it identify it? I already tried echo $ account before the "parent :: __ construct ('$ account');" <?php require_once('usuarios.v.php'); i...
asked by 04.02.2018 / 20:29
1
answer

Problem in calling base constructor in inherited constructor in C ++

I'm getting data structures in college in C ++ and this language is pretty crazy. I'm trying to call the constructor of the parent class in the heiress class constructor, but the following error appears:    error: no matching function for...
asked by 10.09.2017 / 23:10
1
answer

How do I validate a value passed by the Set?

I wanted to know how I would do when adding a new value for the length and width through setLength and SetWidth, and that value goes through validation ((x > 0 & x < 20)? x: 0 ): public class Rectangle { private double length; priva...
asked by 16.05.2017 / 04:15
2
answers

What would be the most efficient way to replicate this code? (Javascript)

Doubt With this code, I can only create and manipulate an "official", I wanted to be able to add more employees by clicking a button and manipulating their data. HTML <!DOCTYPE html> <html> <body> Funcionario:...
asked by 25.05.2016 / 00:37
1
answer

Instantiating one class in another constructor in PHP?

I have a class named teacher that is heiress of another person call, I am trying to instantiate a third class of connection with bank in the class constructor method of Teacher, however it is returned to me Fatal error : Uncaught Error: Call...
asked by 12.06.2018 / 14:17
1
answer

Error with constructor

MyCircle c = new MyCircle(2,5,8);/// Instanciei um objeto no main. public class MyCircle { private MyPoint center; private int radius=1; public MyCircle(int x,int y,int radius) { this.center.getX(x); ///na classe MyPoint...
asked by 11.05.2018 / 04:21