Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

String datatype in java

Tags:

java

string

types

I was wondering, why is it "String" and not "string" when all other primitive data types are lowercase?

like image 284
enchance Avatar asked Apr 19 '11 13:04

enchance


2 Answers

String isn't a primitive datatype - it's a class, a reference type. Now admittedly it's supported directly in the VM, and there are literals in the language - but it's still not a primitive type.

like image 90
Jon Skeet Avatar answered Sep 18 '22 11:09

Jon Skeet


It's not a primitive, the String class is an object.

http://download.oracle.com/javase/6/docs/api/java/lang/String.html

like image 24
dantuch Avatar answered Sep 19 '22 11:09

dantuch