Why we need new operator in java at the time of object
declaration and why not in c++?
Answer / anuja joshi
The major difference between Java and C++ is the behavior of object variables. In C++, object variables hold values, not object references. Note that the new operator is never used when constructing objects in C++. You simply supply the construction parameters after the variable name.
Point p(1, 2); /* construct p */
If you do not supply construction parameters, then the object is constructed with the default constructor.
Time now; /* construct now with Time::Time() */
This is very different from Java. In Java, this command would merely create an uninitialized reference. In C++, it constructs an actual object.
Is This Answer Correct ? | 3 Yes | 0 No |
WAP to print all prime nos between 1 to 100 without using user input...pls reply within few hours...
There are 2 tables: EMP : EmpId, Ename, Sal, DeptId DEPT : DeptId, Dname Write a query to find out emp names and their department names. if any emp has null in Deptid the it shows ?No Department?. Write a query to find out those department names which has no employee. Write a query to find out those employees whose salary is greater than their department?s average salary.
What is the difference between: x=a+b+c+d; and x=SUM(a,b,c,d);?sas
1. Write a program to create a sentence at runtime and count number of vowels in it ? 2. Write a program to get a string and to convert the 1st letter of it to uppercase ?
What is the difference between an EXE and a DLL?
3 Answers ABC, Hykin Solutions, Infoedge, Infosys, Polaris,
what is the extension of SPDS Dynamic cluster tables?
where is available in this mantis toturials?
why we need to take u?
What's the difference b/w Table & Templete in Smartform?
How will you prove that java swing is multithreaded?
Given a arbitrary pointer to an element in a singly linked list?what is the time complexity for its deletion .
In loading programs into memory, what is the difference between load-time dynamic linking and run-time dynamic linking?