Top "New-operator" questions

new is a language construct that dynamically allocates memory from free store and initialises the memory using the constructor.

When is #include <new> library required in C++?

According to this reference for operator new: Global dynamic storage operator functions are special in the standard library: All three …

c++ new-operator include standard-library
Instantiate objects without using new operator

In one of the java interview, the following question is asked: In java is there a way to instantiate an …

java xml new-operator objectinstantiation
What do braces after C# new statement do?

Given the code below, what is the difference between the way position0 is initialized and the way position1 is initialized? …

c# .net new-operator
Why use GWT.create() instead of new?

What is the difference between GWT.create(SomeClass.class) and new SomeClass()? Why would you use one over the other?

gwt new-operator
Namespace 'SharePoint' does not exist in the namespace 'Microsoft'

So I am starting to learn C#, like literally just started learning, and coming from a Java background, it doesn't …

c# .net sharepoint new-operator sharepoint-clientobject
What is the difference between the new operator and Class.newInstance()?

What is the difference between new operator and Class.forName(...).newInstance()? Both of them create instances of a class, and …

java reflection new-operator
c++ what is "pointer = new type" as opposed to "pointer = new type []"?

In many tutorials, the first code samples about dynamic memory start along the lines of: int * pointer; pointer = new int; // …

c++ arrays dynamic-memory-allocation new-operator
inheritance from str or int

Why I have problem creating a class inheriting from str (or also from int) class C(str): def __init__(self, …

python string inheritance int new-operator
Why does the use of 'new' cause memory leaks?

I learned C# first, and now I'm starting with C++. As I understand, operator new in C++ is not similar …

c++ pointers memory-leaks new-operator c++-faq
Can we omit parentheses when creating an object using the "new" operator?

I have seen objects being created this way: const obj = new Foo; But I thought that the parentheses are not …

javascript new-operator