GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  J2EE
Go To First  |  Previous Question  |  Next Question 
 J2EE  |  Question 21 of 104    Print  
what is difference between object and Premitive data

  
Total Answers and Comments: 3 Last Update: April 11, 2006     Asked by: zeeshan980 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: radhika
 

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



Above answer was rated as good by the following members:
rpoordragon
March 27, 2006 07:02:38   #1  
Rammohan        

RE: what is difference between object and Premitive da...

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.


 
Is this answer useful? Yes | No
April 03, 2006 12:25:51   #2  
radhika        

RE: what is difference between object and Premitive da...

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


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
April 11, 2006 05:58:42   #3  
Sathya        

RE: what is difference between object and Premitive da...

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.


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape