What is the package for String Class in Java?
Answers
Answered by
1
Java provides two string classes: String and StringBuffer. Both are defined in the package java.lang, and both represent sequences of char (a 16-bit Unicode character). The key difference between the two classes is that String objects are immutable, and hence can be easily pooled and shared.
Answered by
2
The package used for the String class in Java is java. lang.
- A popular language that is used for development is the Java language.
- To support the string or character data in the programming language Java uses the String class.
- All those related classes, interfaces, etc. are kept in a common namespace. That namespace is known as the package in java.
- So, in order to add the string or character value in a java program, we need to import the particular package for that class.
- That package is java. lang.
#SPJ2
Similar questions