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++?

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


Please Help Members By Posting Answers For Below Questions

qtp 9.2 14 days demo version was expired.I uninstalled how to reinstall this again

2789


what is woransient key word? how it is used in java

2359


why we use abstract word in abstract window toolkit in java language.

2189


9.Difference between even and odd signals?explain with the diagram?

3398


how to add Servlet-api.jar file into eclipse 3.3.2 ?

4587


In mainframe SDSF, Can we copy the list of jobs currently executing in SDSF in to a seperate DATASET...?

2289


Write a program to find whether a given number is prime or not.

1029


In project we have Documentation phase also,in that what is micro and macro designing?

1857


Plz sent me in .net 2.0 interview Question & answers?

2128


in IT trend mantis meant what? how to know mantis in IT trends? detail description about mantis?

2186


1. How many jobs can we write in a single file? 2. How many maximum members can exist in a single partition data set(pds) in jcl?

2374


What is the difference beween joblib and steplib statements

2263


Explain polymorphism. Provide an example.

1033


i want to insert textbox value to sql db. i have only one text box but store four values. ple give any one give sample code in asp.net c#..

3640


THE CHANNEL IN DATA COMMUNICATION CAN BE?

2033