answersLogoWhite

0


Best Answer

No, there is no such operator or function in Java that can tell you the amount of memory an object uses.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you find size of any object in java OR is there any operator or fun.. equivalent size of in c plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Which operator works like sizeof operator in Java?

Java does not have the sizeOf() operator or any operator that gives an equivalent result.


What does the java 'this' operator do?

It refers to the currently running object.


What is a operator overriding in java?

Java does not support object overriding. It does support operator overloading by means of the "+" symbol which is used for both numeric addition as well as string concatenation.


How do you find the size of a class object?

Java does not have a sizeOf() operator and hence there is no way we can actually determine the size of a java class object. However we can analyze the overall heap space utilization to try to get an approximate indication of how much memory is used by an object but it is not accurate.


Explain the role of sizeof operator in java?

There is no sizeOf() operator in Java.


What is use of new operator is it necessary to be used when object of the class is crated why?

In the case of the Java language, it is necessary. The reason is because that's how creating objects was defined in Java. Note that a method can return an object, so the use of the "new" operator may be hidden: x = SomeClass.someMethod(); In this example, is someMethod() returns an object, x will point to this object; however, the "new" operator is still used in the method someMethod().


When the Java Virtual Machine sees the new operator in a program it instantiates an object for a specified class.?

Yes.


What are the differences between Java OOP and PHP OOP?

JAVA is an Object Based Programming Language. it doesn't provide multiple inheritance and operator overloading. while Object Oriented Lanuages provides both.


Operator overloading is possible in java or not?

Java does not support opperator overloading, so the answer to your question is: none.


What happen when a java keyword new is used in an application?

When the new operator is used, a new object is created, based on the specified class.When the new operator is used, a new object is created, based on the specified class.When the new operator is used, a new object is created, based on the specified class.When the new operator is used, a new object is created, based on the specified class.


difference between object and oriented program?

JAVA is an Object Based Programming Language. it doesn't provide multiple inheritance and operator overloading. while Object Oriented Lanuages provides both.


What are the similarities between c plus plus and java?

C++ and Java are identical except for...No pointers in JavaAll object names are referencesNo operator ->, only operator .No multiple inheritance in JavaNo template classes in JavaThe run-time and class libraries are vastly different