Why we need new operator in java at the time of object
declaration and why not in c++?
Answer Posted / 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 |
Post New Answer View All Answers
In project we have Documentation phase also,in that what is micro and macro designing?
Can we write a method in JSP.If so how?
how can i create report in abap to insert data in table pa0002 using insert command
I have try to write a record in a TDQ from a fle.... what are the steps to do... can anybody plz come with a solution
I am looking for NIC Sample papers or any patern of questions/ syllabus plz, send me on hamid.khan135@yahoo.in Regard
iam confused to choose among testing, .net and java can anybody help me????????
what are the differences between CONS, LIST, and APPEND
what is the current salary package in India for a lamp programmer
what is best way to create a Thread class & why?
how to remove header and footer in jcl using sort utility
When you deliver your C++ headers and C++ library of a class (what all can you change in the class so that application using your class does not need to recompile the code)
How to connect the .accdb database file of microsoft access to the Visual Basic 6.0 forms?
What is the difference between DECISION COVERAGE(DC) and MODIFIED CONDITION/DECISION COVERAGE(MCDC)?
THE CHANNEL IN DATA COMMUNICATION CAN BE?
can u send some model papers how computer awareness questions are asked in goverment jobs(oriental insurance)to my mail id me.priyankapadma@rediff.com