티스토리 뷰

JAVA

Reference Data Type in Java

seoca 2019. 2. 20. 12:39



Unlike primitive data type, the reference data type is user-defined, for which it contains a 

reference or an address. It has Array type, Class type and Interface type etc.


create a reference data type 

Person p;  

allocated statically in the stack at compile time.


create a reference data type and object

Person p = new Person(); 

allocated dynamically in the heap




Reference

https://www.quora.com/What-are-reference-data-types-in-Java

https://www.quora.com/What-is-the-difference-between-a-reference-variable-and-an-object-in-Java-How-can-I-create-both

'JAVA' 카테고리의 다른 글

Lambda Expression in Java  (0) 2019.02.22
compareTo method in Java  (0) 2019.02.21
Anonymous class in Java  (0) 2019.02.20
What's the difference between two different List declaration?  (0) 2019.02.02
Upcasting (Object type casting) in java  (0) 2019.01.30