String class is defined in java.lang.String.
It represents character strings (or array of character).
Like any other java class String can be initiated using following syntax:
Class_name identifier = new Class_name(para);
For example, String name = new String("JAVA");
However, as String is commonly used class, it can be initiated as a data type (like int, char),
For example, String name = "JAVA";
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment