class-constructors Questions

9

Solved

Working on a project I made a class with properties and when I tried to auto-generate a class constructor I got an error saying something on lines of "auto generation of class constructor fail...

3

Solved

I believe I have some sort of understanding of what __new__ is supposed to do (create an instance, of a class, but not initialize it, that is the job of __init__). I'd like to understand, however, ...
Sinclair asked 8/8, 2019 at 22:18

2

Solved

Do I have to write param and return tags for constructors in Java for API documentation? This is the code I have: /** * Another constructor for class Time1 */ public Time1 (Time1 other) { _hou...
Essayistic asked 27/12, 2015 at 16:38

1

Solved

I'm just starting out with the basic concepts OO in PHP, Foo.php class Foo extends Command { public function __construct() { parent::__construct(); } public function fire() { $bar = ne...
Igorot asked 2/11, 2014 at 10:5

4

Solved

Can someone please explain the following syntactic sugar? protected MyConstructor() : this(null) Mainly I am interested in this part: ": this(null)" I know how protected, constructors and "this...
Amongst asked 15/1, 2014 at 17:27

2

Solved

I am rewriting some code to eliminate global variables and made a class constructor/destructor handle cleanup of some third party library resources, but I am concerned about some code which initial...
Indented asked 19/2, 2013 at 20:12

2

Solved

Consider the following example (I am using Delphi XE): program Test; {$APPTYPE CONSOLE} type TTestClass<T> = class private class constructor CreateClass(); public constructor Create()...
Haggerty asked 29/2, 2012 at 15:2

3

Solved

I am writing a simple dependency injection / inversion of control system based on a TDictionary holding abstract class references with their respective implementor classes. My goals are: Avoid ...
Radford asked 3/6, 2011 at 19:40

3

Solved

Let's say that I have a class (ClassA) containing one method which calls the constructor of another class, like this: public class ClassA { public void CallClassBConstructor() { using(ClassB my...
Got asked 2/9, 2010 at 11:27

6

Solved

This isn't valid code: public class MyClass { private static boolean yesNo = false; static { if (yesNo) { System.out.println("Yes"); return; // The return statement is the problem } Syst...
Jackknife asked 9/4, 2010 at 11:53
1

© 2022 - 2024 — McMap. All rights reserved.