Questions tagged [construction]

Use for questions related to building a data structure, such as a heap.

Construction is a concept of Object-Oriented languages.

Objects need to be setup for use:

  • Their member variables need to be allocated
  • Any Object member variables also need to be constructed
  • The Object methods need to be setup for calling

This process is accomplished by construction.

112 questions
0
votes
5 answers

Construct object from LINQ using same fields of another query

That's example SQL create view v_join as select m.* , d.oneDetail from master m, detail d where m.key = d.key LINQ var view = from v in dc.v_join select new { Master = ???? /// that is an issue, how can I construct the objects using same…
igor
  • 91
  • 1
  • 1
  • 4
-1
votes
1 answer

Is there a Pythonic way to create a list of cloned items?

Consider the following code: class SomeClass: def __init__(self): self.foo = None some_list = [SomeClass()] * 5 The problem with this code is that all 5 items of some_list refer to the same instance of SomeClass. If I do…
Serge Rogatch
  • 13,865
  • 7
  • 86
  • 158
-1
votes
1 answer

How can I use the same properties and methods on different classes?

I have 3 class like ClassVersion1, ClassVersion2 and ClassVariables. ClassVariables is for reach variables of other class from Form. İn my opinion were these; if(version == 1) { ClassVersion1 clss = new ClassVersion1(); } else { …
TheDebugger
  • 149
  • 2
  • 9
-1
votes
2 answers

how to elegantly construct long argument lists that iterate through arrays in C

I have a C function that takes variable arguments, and I need to call it with a very long list of arguments, where the arguments all step through the elements of an array. Example: myFunction( A[0], B[0], A[1], B[1], A[2], B[2], A[3], B[3], .....…
-1
votes
1 answer

Javascript - is it possible to access an array like var b = 'opt' + 5; alert(b[61]);?

In PHP, I can do something like: $name = "options{$a}"; // or "options" . $a, doesn't matter for ($i = 0; $i < count($name[$i]); $i++) { // do something... } as long as options0 exists (assuming $a is 0, or 1, or whatever), this construction…
Julio María Meca Hansen
  • 1,303
  • 1
  • 17
  • 37
-3
votes
2 answers

Object doesn't get constructed

I've noticed this weird behaviour/bug where a class method is called before the actual object is initialized. I have a wrapper object, which has operator->() method. Now, when I'm passing the object to another object as constructor parameter in a…
weggo
  • 134
  • 3
  • 10
-7
votes
3 answers

Name of construction

private final EventManager eventManager; private final DateManager dateManager; private final UserManager userManager; What is the name of this construction? Is this object or something else? EventManager, DateManager, UserManager are the names of…
1 2 3 4 5 6 7
8