Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Why we need new operator in java at the time of object
declaration and why not in c++?



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

Post New Answer

More Programming Languages AllOther Interview Questions

I would like to know what is Intellimatch and some interview questions which could be asked related to Intellimatch.

3 Answers  


What are the main principles of OOP?

1 Answers  


How to use string functions in QTP?give some examples

1 Answers  


how to hide prompts

0 Answers  


how to generate dsnless connectivity in j2ee

0 Answers  


can we convert .class file to dll file

1 Answers  


What is a must for multitasking? a) Process preemption b) Paging c) Virtual memory d) None of the above

9 Answers   InterGraph,


To sorting array of 10 elements which sorting is best a)selection b)bubble c)tree sort

2 Answers   HP, Hughes,


what is the diffrence between occur 0 and occur 10 in ABAP.

0 Answers  


Busy waiting is a method whereas a taskwaits for a given event by continiously checking for an event to occur. What is the main problem with this approach

0 Answers  


1.how to deploy the Maven application in weblogic server? 2.In Real time projects all classes are singleton or some classes only singleton explain? 3.what are the major uses of the designpatterns? 4.explain restful &Soap based services explain?

0 Answers   Accenture,


SAS using companies in INDIA

29 Answers   Bank Of America, Cap Gemini, Hyundai, IBM, KO, Sristek, TCS, Wipro, WNS,


Categories