- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What are reference data types in Java?
Reference datatypes in java are those which contains reference/address of dynamically created objects. These are not predefined like primitive data types.
Following are the reference types in Java.
class types − This reference type points to an object of a class.
array types − This reference type points to an array.
interface types − This reference type points to an object of a class which implements an interface.
Once we create a variable of these types (i.e. when we create an array or object, class or interface).
These variables only store the address of these values.
Default value of any reference variable is null.
A reference variable can be used to refer any object of the declared type or any compatible type.
Example
Animal animal = new Animal("giraffe");
- Related Articles
- What are reference data types in C#?
- What are the data types, value types and reference types in C#?
- What are primitive data types in Java?
- What are primitive data types in JavaScript?
- What are enumerated data types in C++?
- What are Complex Data types in JavaScript?
- What are pointer data types in C#?
- What are nullable data types in C#?
- What are dynamic data types in C#?
- What are object data types in C#?
- Data types in Java
- What are JavaScript data types and data structures?
- How to declare reference types in JShell in Java 9?
- What are different Perl Data Types?
- What are compound data types and data structures in Python?

Advertisements