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

what is delimiter in sas ?

0 Answers  


how many logical drive we can form to physical device in our computer?

1 Answers   nvidia,


What is algorithm in SCD Type2(SAS DI Studio Transformaton)?

2 Answers  


what is best way to create a Thread class & why?

0 Answers  


why we need to take u?

0 Answers  


As per interoperatbility programs written in one language can be used by other language. How can we restrict the features of one language (say C#) in the programmer written in another language (say VB)..for example we have some features like operator overloading which is possible C#.NET (not in VB.NET), how can we restrict that when we are using this code in VB.NET.

0 Answers   Tesco,


Data Structure:  How many comparisons are necessary to find the largest and smallest of a set of n distinct elements?  

0 Answers   Student,


what is the software to run the GSM gate opener program

0 Answers  


when will triggars the at new event in abap and web dybn pro?

0 Answers   TCS,


I want to insert date in the form of yyyy-mm-dd... if any changes happen while inserting date format want to show error meg...any one can solve this..??

0 Answers  


how do find the user exit for selected feild whatis the process and can u plz explain it

0 Answers  


What is %Type,%Rowtype?

0 Answers  


Categories