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 |
Need provab technical test questions
Q2. A memory location has physical address D5687h. Compute: a. The offset address if the segment number is D445h. b. The segment number if the offset address is B577h.
In Java what is the difference between following two statements ? int a[],b; int []a,b;
What is Console Application? & The purpose Of Console Application? with description.
how to generate dsnless connectivity in j2ee
write a sql qwery which include joining of two tables 4 marks mainframe
7.x=10; y=20; x<<2=? x<<1=? y>>2=?
what is the similarity between networking devices?
What is abstract Method i want the exact definition and is there any possibility to declare class as abstract without any abstract methods in that class?If it is possible then tell me why and how?
It is possible to take number of controls added to form at run-time.ex-when user enter 6, 6 text boxes get added to form,next time number of controls get change as per user number enter. What is code for that?
To sorting array of 10 elements which sorting is best a)selection b)bubble c)tree sort
design a counter with the following repeated binary sequence: 0, 1, 2, 3, 4, 5, 6, 7, 8 using JK Flip Flop.
3 Answers College School Exams Tests, IBD, IBM, Ignou, IIIT, Nortech, TCS, UOS,