I know this is a weird question and maybe a little vague. Because I myself isn't sure about what I'm really missing. But please hear me out.
In java, there are :
value types
(likeint
,char
, ...).reference types
(likestring
,user-defined classes
,...)
> int age;
> String name;
I know that the value types are primitive and simple unlike the ref type.
But why is int
here just a deceleration keyword and String
is an actual class?
I hope this sounds right. I know it's probably not the right question to ask but maybe you can help me figure out what I don't know that I'm missing.