reference type | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

reference type

can someone explain the meaning of reference type using the simplest way?i'm still new to java

19th Oct 2017, 1:54 AM
oyl
7 Answers
+ 28
A reference type is a data type that’s based on a class rather than on one of the primitive types that are built in to the Java language. The class can be a class that’s provided as part of the Java API class library or a class that you write yourself.
19th Oct 2017, 1:59 AM
Nithiwat
Nithiwat - avatar
+ 27
You can study this in the course. https://www.sololearn.com/Course/Java/
19th Oct 2017, 2:10 AM
Nithiwat
Nithiwat - avatar
19th Oct 2017, 3:33 AM
Zephyr Koo
Zephyr Koo - avatar
+ 5
A reference type is something that is passed by reference. IE is an Object. int[] a = {6}; someMethod(a); void someMethod(int[] b){ b[0] = 2; // a becomes {2} }
19th Oct 2017, 2:44 AM
Rrestoring faith
Rrestoring faith - avatar
+ 2
@Nithowat.i have no idea what u are saying.could you provide an example if possible?thankyou
19th Oct 2017, 2:02 AM
oyl
+ 2
@Nithowat.i dont understand the course that's why im asking for help here..
19th Oct 2017, 2:19 AM
oyl
+ 1
@Zephyt Koo that is the best explanation so far
19th Oct 2017, 4:57 AM
oyl