Cursos
Cursos
Compilador de Código
Compilador de Código
Discutir
Teams
Fazer login
Registrar
Menu
Q&A Discussões
Pesquisar
Pesquisar
Faça uma pergunta
Faça uma pergunta
In Java, can you pass an object to a method within the constructor for that object?
java
1 Voto
1 Resposta
3rd Feb 2017, 6:17 AM
Daniel
can anyone teach me about constructor in java... pls help me its urgent... thanks in advance...
java
-1 Voto
2 Respostas
8th Sep 2017, 4:23 PM
Sauvik Saha
what can i do for call a private constructor from another file to open a window?
constructors
java
package
pc
private
0 Voto
1 Resposta
25th Feb 2017, 3:01 PM
Ismael Perbech
Can anyone plz elaborate the calling of constructor and destructor by giving some program as example?
c++
constructors
0 Voto
1 Resposta
23rd Jul 2016, 7:21 PM
Kaivalya Dalvi
Does anyone have a MyString constructor I could look as a reference? Be a great help☺
java
0 Voto
1 Resposta
25th Mar 2017, 5:58 PM
bobo
IN CPP Using class initializer list?
constructor
initializer_list
oops
1 Voto
2 Respostas
2nd Mar 2018, 4:56 PM
Melodemon Alpheus
BASE CLASS CONSTRUCTORS AND DESTRUCTORS ARE NOT INHERITED TO DERVIED CLASS ..THEN HOW THIS ...
constructor
destructors
inheritance
1 Voto
2 Respostas
6th Nov 2017, 4:47 PM
I'm_Groot
My base class has constructor and derive class has default constructor, but it can't compile. Can anyone give me a proper explan
base
c++
class
derive
inheritance
1 Voto
3 Respostas
18th Oct 2019, 1:28 PM
#ArizmaAltair PATHAN
In OO languages, what is the advantage of using factory methods and private constructors to create objects?
advantage
constructor
factory
method
oo
private
6 Votos
8 Respostas
15th Dec 2019, 11:13 PM
Sonic
Why not able to use initializer list
c++
constructor
initializer_list
0 Voto
1 Resposta
27th May 2022, 11:47 AM
Ketan Lalcheta
How to make a site?
constructor
css
html
js
0 Voto
3 Respostas
13th Nov 2021, 9:12 AM
Матвей Барканов
It is successfully Compiled but The Result is null. Why
conditional
constructor
if
input
java
1 Voto
5 Respostas
9th Mar 2023, 8:05 AM
We Doru
In a class,if we have a constructor and methods with same name and without argument is this is possible to have like this?
i
needit
0 Voto
7 Respostas
29th Jul 2017, 4:25 PM
vani s
Why, when I input 42 to the circle constructor the area gives me 5541.769440932395 while the correct answer is 5541.769440932396
abstractclass
inheritance
java
oop
1 Voto
1 Resposta
27th Dec 2022, 10:34 PM
Genniell Vergaray
Java: How can the object of parent class call the parameterized constructor of child class while it's not the other way around?
classes
constructors
java
objects
0 Voto
4 Respostas
26th Apr 2022, 9:36 PM
Farzam Baig
Why we need to call super() method in default constructor?? why we need to parent class constructor ?? why it is compulsory?
constructors
java
oop
1 Voto
5 Respostas
9th Oct 2017, 9:20 AM
Ankit Singh Rawat
How do you know when you have too many methods on the prototype/constructor and how can you plan to use a fair amount of each?
classes
constructor
javascript
memory
objects
prototype
4 Votos
5 Respostas
6th Jan 2019, 10:47 PM
Thomas Czernek
C++ How to avoid Object Slicing with derived classes being stored in base vector
c++
constructor
object
slicing
0 Voto
4 Respostas
10th Apr 2020, 4:22 PM
Tyler
What's the advantage of member initializers?
c++
constructor
initializer
member
2 Votos
1 Resposta
5th Apr 2019, 7:54 PM
HonFu
If a class that inherits from another class automatically also inherits its constructor then why bother using super().__init__?
python
python3
0 Voto
1 Resposta
28th Apr 2022, 8:07 AM
Lenoname
JS : What exactly is CLASS and in what case do you need it?
class
constructor
js
purpose
use
3 Votos
5 Respostas
2nd Jan 2022, 6:13 AM
Ginfio
If I inherit derived class from base class as private what will be the order of constructor and destructor?
c++
inheritance
1 Voto
2 Respostas
30th Aug 2016, 4:53 PM
Sunitha Ganti
[javascript] Syntax for adding method to retrieve properties from that class?
class
constructor
javascript
method
0 Voto
4 Respostas
6th Dec 2017, 7:38 AM
Joe
if a sub class besides those inherited attributes has it's own attribute how should the constructor look like?
java
0 Voto
1 Resposta
21st Sep 2022, 10:37 PM
Lenoname
How do I pass arguments to the superclass constructor while creating an object of the subclass in this case?
inheritance
1 Voto
1 Resposta
15th May 2019, 1:56 AM
Debraj Singh
Destructor + unset
constructor
destructor
php
0 Voto
1 Resposta
8th Jun 2019, 5:23 PM
Maksym Biliaievskyi
Problems with object constructors
constructor
html
javascript
js
object
objects
web
7 Votos
14 Respostas
15th Nov 2017, 10:04 PM
Jay
OOP with JS ,, Could you help me with OOJS ? Object-oriented javaScript
class
constructor
javascript
objects
oop
1 Voto
4 Respostas
19th May 2020, 8:45 PM
Raven
When we create objects of one class its constructor is invoked and we call its destructor then can we again use the object after
constructors
3 Votos
2 Respostas
24th Oct 2021, 12:55 PM
Abhishek Pandey
How to write constructor for class B if it is a derived class of A? How to instantiate?
c++
constructors
inheritance
0 Voto
2 Respostas
23rd Nov 2016, 1:51 PM
Marcell Juhasz
From the code given below, the output should be 12(because constructor never inherit ) but it is 112 . How? Someone can explain.
c++
constructors
inheritance
0 Voto
5 Respostas
21st Dec 2016, 4:09 AM
blumen
why destructor in this code doesn't runs in visual studio's console application
c++
constructor
destructors
error
sololearn
2 Votos
5 Respostas
27th Aug 2018, 4:56 PM
Suraj Jha
C#, I'm struggling with everything. Please assist.
constructor
inheritance
polymorphism
0 Voto
1 Resposta
18th Aug 2017, 10:43 AM
Mncedisi Nceddy Mzizi
Constructor Chaining in Java Please help what is wrong in this code as it does not compile and throws exception at this(hello())
constructors
inheritance
java
super
this
0 Voto
2 Respostas
23rd Aug 2020, 10:18 AM
anshu kulshrestha
Is use of constructor in any program good or bad, if bad. What is another solution for construction based problems?
c++
python3
0 Voto
2 Respostas
6th Oct 2019, 3:22 PM
Pushpendra Singh
what if i declare a parameter inside constructor which has private access specifier, would parameter also be private?
cpp
0 Voto
1 Resposta
13th Aug 2018, 2:21 PM
Arush Joshi
Although we have a default protected constructor in abstract class , why we can't create a new instance from it?
abstract-classes
c#
oop
1 Voto
2 Respostas
2nd Aug 2017, 4:01 PM
Amin Saadati
(a) When p3 object is created, specify which constructor gets invoked and why? (b) Write complete definition for Constructor3.
and
constructors
des
0 Voto
1 Resposta
29th May 2018, 6:29 AM
heer patel
Why do we make an object constructor using this keyword and don't we simple write return { a: x, b:y} in the function?
javascript
2 Votos
1 Resposta
27th Oct 2020, 5:27 PM
Karak10
Is a globally declare function whose name is same as that of class can be a constructor in c++?
constructors
declare
globally
0 Voto
2 Respostas
16th Feb 2017, 1:08 PM
Deepika Behera
Why 6 calls to destructor for 5 objects?
c++
constructor
copy-constructor
destructor
vector
1 Voto
1 Resposta
30th Jun 2022, 9:31 PM
Edward Finkelstein
I really want to know what is constructor function? I make plenty of research on it but still I did not get exactly what it is.
c#
java
0 Voto
3 Respostas
3rd Oct 2021, 11:30 AM
Azzuro
Anyone can explain this?? Generally a constructor of base class doesn't inherit to derived class..... But here I'm confused...
c++
classes
constructors
0 Voto
1 Resposta
9th Sep 2017, 2:06 PM
Harsha Sanju
Constructor of every object in vector is called everytime I add a new element. How do I resolve this?
c++
0 Voto
1 Resposta
27th Mar 2017, 1:09 PM
denzal maradona
Is there any difference between creating new object with the default copy constructor and declaring a reference to it?
c++
copy_constructor
reference
0 Voto
1 Resposta
26th Nov 2016, 3:29 PM
Marcell Juhasz
Why do we need a constructor to set up start values for attributes when we can already set them right after declaring attributes
attributes
constructors
1 Voto
3 Respostas
27th Apr 2017, 4:20 PM
Tina
C++ Class Constructors and Destructors Access Specifiers
access-specifier
c++
class
constructor
destructor
1 Voto
3 Respostas
6th Sep 2020, 5:13 AM
Edward Finkelstein
Throwing exception during object creation
bestpractice
constructor
exception
oop
technique
0 Voto
3 Respostas
7th Jan 2022, 10:03 AM
Agnes Ahlberg
How should the class look like?
c++
char
class
constructor
cpp
0 Voto
3 Respostas
1st Sep 2020, 1:55 PM
Oliver
Unexpected Inheritance Output
c++
constructor
destructor
inheritance
output
0 Voto
4 Respostas
21st May 2018, 4:51 AM
Michelle
Faça uma pergunta
Faça uma pergunta
Faça uma pergunta
Faça uma pergunta
< Anterior
1
...
11
12
13
Próximo >
Quente hoje
Someone can help me
2 Votes
What's wrong with this?
2 Votes
HTML community, HELP!!
1 Votes
X velocity
0 Votes
I am a super beginner
0 Votes
Files not linking in C++
0 Votes
Img & web server or personal info
0 Votes
Web Dev
0 Votes
I want to make a triangle area calculator ,anybody can teach me
1 Votes
How this program executes?
0 Votes