What is difference between object and Premitive data

Questions by zeeshan980

Showing Answers 1 - 15 of 15 Answers

Rammohan

  • Mar 27th, 2006
 

Hi ,

object is one of the user defined class in java.using which you can define your own data type, which can store your any type of data like integer,numeric,character(no limit on storage) etc...where as primitive data type are short,int,float,char etc..these all data types has some limitation in storage and type of data you would to store.

so finally what i am saying is object is the super class and user defined type.where as primitive data type are predefined data types,which is designed by who develop the java software.

Thanks

Ram.

  Was this answer useful?  Yes

radhika

  • Apr 3rd, 2006
 

Adding to the above, the one important difference between object and primitive type is that when you pass them as parameters to a method,

1.the object is passed  by reference where as

2.the primitive is passed by value.

Thanks,

Radhika

Sathya

  • Apr 11th, 2006
 

OBJECTS SIT ON HEAP

PRIMITIVES (LIKE INT, DOUBLE ETC) SIT ON STACK

STACK IS FASTER THAN HEAP.

OBJECTS ARE PASSED BY REFERENCE.  PRIMITIVES ARE PASSED BY VALUE.

OBJECTS ARE GARBAGE COLLECTED.  PRIMITIVES ARE CLEARED FROM THE STACK BY MOVING THE STACK POINTER UP AND DOWN.

  Was this answer useful?  Yes

Prasann Mishra

  • Sep 27th, 2015
 

For your knowledge in Java everything is passed by value, there is no pass by reference. Check the Java docs.

  Was this answer useful?  Yes

Sukhrob

  • Dec 24th, 2015
 

Primitive data types like byte, short, int, double, long they store data while object only has reference to the declared data. When object type called it references to the declared type.

  Was this answer useful?  Yes

Parag jain

  • Jul 5th, 2016
 

Data objects are collection of one or more piece of data and data type is only one type of data like int, char, float

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions